在Git中区分大小写 [英] Case sensitivity in Git
问题描述
我遇到了git的问题。基本上我设置为false core.ignorecase
,因为我想改变一些文件夹名称的大小写(因为我在OSX下不区分大小写的文件系统,所以更改没有另外显示)。当我拉取数据时,我发现现在每个重命名的文件夹都会在资源库中出现两次,包括旧名称和新名称。我不知道该怎么做才能删除旧的文件夹,因为它们没有在本地出现(我试着将 core.ignorecase
再次设置为true,但它不是'
I've run into a problem with git. Basically I set to false core.ignorecase
because I wanted to change the case of the names of some folders (since I'm under OSX with a case-insensitive filesystem, the changes weren't shown otherwise). When I pulled my data, I've noticed that now every renamed folder appears twice on the repository, with both the old and the new name. I don't know what to do to remove the old folders since they don't appear locally (I've try to set core.ignorecase
to true again but it isn't helping).
推荐答案
可能是一种解决方法,类似于在msysgit问题中的这个注释(对于另一个不区分大小写的操作系统:Windows)可能有帮助吗?
May be a workaround similar to this comment in an msysgit issue (for another case-insensitive OS: Windows) could help?
我遇到了同样的问题。在Eclipse中重构了一个包名称,并且由于文件夹名称未恢复而切换到以前的构建。我使用Windows 7,Git 1.7.0.2.msysgit.0
I've encountered this same issue. Refactored a package name in Eclipse and switching to a previous build broke due to the folder name not reverting. I'm using Windows 7, Git 1.7.0.2.msysgit.0
我的文件夹在Windows中重命名为文件夹
,但在Git中显示为文件夹
。
我通过将其重命名为 Folder
,然后运行:
My folder was renamed in Windows to "folder
" but was displayed as "Folder
" in Git.
I fixed the issue by renaming it to "Folder
" in Windows and then running:
git mv "Folder" "Folder2"
git mv "Folder2" "folder"
请注意,自从git 2.0.1(2014年6月)开始, git mv文件夹文件夹
应该可以正常工作!
Note that since git 2.0.1 (June 2014), git mv Folder folder
should just work!
请参阅 Git:更改文件名的大小写
这篇关于在Git中区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!