Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 206
axk Avatar asked Mar 06 '23 10:03

axk


1 Answers

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

like image 126
axk Avatar answered Apr 26 '23 01:04

axk