axk
axk

Reputation: 5404

Git on Windows: "merging" 2 directories with the same name but different case

The word "merge" does not refer to a git merge, but just moving all the files to the same directory.

We somehow came to have two directories with the same name but different cases in our git repository. Windows is case-insensetive in this respect so it works fine just checking out all the files from both directories into one directory on disk.

Still would like to get rid of this "duality"

Is there a way to fix this using Windows git clients?

I've tried git mv, but it appears to be case insensetive. I expected it to move only the files that are under the lowercase version of the directory but it moved both directories.

Upvotes: 6

Views: 2974

Answers (1)

axk
axk

Reputation: 5404

This worked for me:

git mv myfolder tmp_folder
git mv tmp_folder MyFolder

Even though it initially removed MyFolder and moved all the files under tmp_folder after issuing the second mv it worked as expected staging renames for the files in myfolder to be moved to MyFolder

Upvotes: 12

Related Questions