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

我的未来我决定 提交于 2019-12-22 10:58:23

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/49804345/git-on-windows-merging-2-directories-with-the-same-name-but-different-case

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!