Search code examples
giticloud

After doing some git operations, I end up with multiple files duplicates on my finder


I just did a rebase on my project and a lot of files were duplicated.

enter image description here

This happened right after I did a rebase onto the develop branch.

Deleting the files do no harm to the project, but I want to know what is causing this problem so I can fix it.


Solution

  • You should not store your Git repository in iCloud Drive or any other sync service.

    Git makes lots of changes to files very quickly and iCloud might not keep up. For example, a rebase can change hundreds of files hundreds of times in a few seconds. iCloud doesn’t want you to lose data, so it will err on the side of caution.

    Since you’re not editing the files interactively, it doesn’t have a chance to give you a conflict resolution GUI, so it will default to keep both, and increment a number.