13

Google Drive weirdly allows files/folders with the same name in the same location. This leads to having a lot of duplicate files/folders in my drive that I don't know any way to merge. How to merge them and prevent this in future?

OneDrive does not allow duplicate file name that makes sense. Any way to make GDrvie function as expected?

The problem is also detailed here by another user https://freefilesync.org/forum/viewtopic.php?t=6483&sid=d16c0cee85bac283e6ed7160e21f6d32

4
  • ⚠️ Be very careful when you delete a folder ONLINE with the same name, and there are two of them. It seems that as a result, on the synching desktop (which has the folder only one time, of course), this one folder gets deleted BY NAME on the computer. Just happened to me.
    – Avatar
    Commented Oct 2, 2023 at 10:10
  • 1
    @Avatar thanks for your comment. Yes, I was careful and stopped using GDrive. Commented Oct 3, 2023 at 23:29
  • I started using Nextcloud. Open source, and you can setup your owner server is needed. When used with a hoster, the max upload connections are reduced to 100, depending on the hoster. But now I can choose to sync a folder on two computers.
    – Avatar
    Commented Oct 4, 2023 at 5:52
  • BUT also be careful with Nextcloud. They have IMO a huge usability bug, that deletes files too! See over here: github.com/owncloud/client/issues/2502
    – Avatar
    Commented Oct 5, 2023 at 1:41

3 Answers 3

4

As marikamitsos notes, it's intended behavior. A de-duplication app or script should be able to deal with the problem. There are many, but it depends on your OS which can run. I haven't found a really good one. To me that means one that can understand and make use of hard links, and is quite customizable. So all I've done is write some shell commands I haven't worked into a script yet to replace a duplicate file with a hard link to the same file. Also, as you have different versions, the problem is tougher, and situation and document-dependent. Word is good at merging documents it can handle. Maybe you want the older files deleted; maybe something else. I run something like this crap to find dupes in Downloads folders from people who unintentionally download the same thing repeatedly:

cat crc32s.txt >> crc32s.old.txt ; time crc32 * > crc32s.txt ; \
cat crc32s.txt  crc32s.old.txt | \
sort --key=1 | uniq -u | \
sort --key=2 | uniq -d -f 1 | tee crc32s.changed.txt 

There should be FAR better solutions out there... (and there are many alternatives to crc32, such as md5 and sha.)

It sure is weird! I can't think of an OS that does. NOT DOS, Win32, HFS,APFS(MacOS), NFS, ext3, or AFS, as I recall. MacOS has time machine, which allows versioning, as does Google Docs, etc. But "two files with the same name in the same folder"? (No, not a different extension? Nope.) Sure is odd. And, if the two files are identical, it still stores them separately, using double the space! According to the UI anyway!

I have "two files with the same name in the same folder in Google Drive" and was wondering if that's a feature or a bug too.

I googled that phrase and the only thing that turned up was a deleted superuser.com post but now this Q&A will turn up.

I'm also curious what happens if I have my google drive sync'd (w/ "Backup and Sync") to my local drive, where this can't happen Like the OP, I copied a file into a folder that already contained the file and now there are two copies. I've seen this a few times.

1
  • 1
    I too upvote your because it explains the "oddity" of the situation. Especially since "I googled that phrase ... now this Q&A will turn up." I am also interested on "what happens if I have my google drive sync'd...". Please try it out using test folders/files and let us know. Commented Sep 14, 2020 at 19:55
2

You mention:

Google Drive weirdly allow files/folder with the same name in the same location.
How to merge them and prevent this in future?

weirdly
It is NOT weird. Google Drive keeps track by file/folder ID and NOT by name. As a result files/folders can have the same name.

prevent this in future
It is up to you to properly rename them when uploading/creating them.

merge
You cannot merge them as such. There is no such action. At least not within the drive.

A workaround

What drive allows for non-Google files is versions

enter image description here

This way you can upload different versions of the same file.

enter image description here

More info at: View activity and file versions


EDIT

In any case, you can send a request to Google using the help found on the top right hand corner.

enter image description here

7
  • Please remember that as per site guidelines when an answer addresses your question, accept it and even upvote it so others can benefit as well. Commented Jul 20, 2020 at 5:40
  • 5
    Trust my, it's so so weird. I need GDrive to use the filename as ID, similar to local storage. Is there any way to fix that mess? Commented Jul 20, 2020 at 23:13
  • "I need GDrive to use the filename as ID". As explained in my answer, what you ask for cannot be done. Local storage or Drive One (as mentioned in your edit) have a different way of archiving than GDrive. In any case, since your question has been answered -even if in a negative way- please accept it so others can be helped as well. Commented Jul 21, 2020 at 21:24
  • I really appreciate your attempt. You "answer" just repeat the question. There should be a way to remove duplicate in an efficient way. So let open it to get more opinions. Commented Jul 21, 2020 at 22:55
  • 1
    In your question you asked for "How to merge them and prevent this in future?". Not remove. In your comment you asked for something else. "I need GDrive to use the filename as ID". If you just want to remove your existing duplicate files you could try a script to list them and then delete them. This script may be of some help. I hope someone else chips in. Commented Jul 21, 2020 at 23:49
1

rclone has dedupe command which appears to be created for this exact scenario you mentioned. It will find duplicate files and offer options to delete or rename duplicates.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.