Windows上的Git:“合并” 2个名称相同但大小写不同的目录 [英] Git on Windows: "merging" 2 directories with the same name but different case

查看:259
本文介绍了Windows上的Git:“合并” 2个名称相同但大小写不同的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

合并一词不是指git合并,而是将所有文件移动到同一目录。

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

我们以某种方式在git存储库中有了两个名称相同但大小写不同的目录。 Windows在这方面是不区分大小写的,因此只需将两个目录中的所有文件检出到磁盘上的一个目录中,它就可以正常工作。

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"

是否可以使用Windows git客户端解决此问题?

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

我尝试过git MV,但似乎不区分大小写。我希望它仅移动目录小写版本下的文件,但会移动两个目录。

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.

推荐答案

对我来说:

git mv myfolder tmp_folder
git mv tmp_folder MyFolder

即使它最初删除了 MyFolder 并将所有文件移至 tmp_folder下发布第二个 mv 后,它按预期的方式将 myfolder 中文件的暂存重命名为移至 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

这篇关于Windows上的Git:“合并” 2个名称相同但大小写不同的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆