我不太确定这里发生了什么,但有时候我的存储库中的某个特定文件会改变它的名称。例如:
之前: File.h
after: file.h
我不在乎为什么会发生这种情况,但这会导致git认为它是一个新文件,然后我必须去改变文件名。你可以让git忽略大小写变化吗? $ p $ b我怀疑这是Visual Studio在特定情况下做了些奇怪的事情文件,因为它在更改后打开并保存时似乎最常发生。我没有任何方法可以修复VS中的错误,但是git应该更有能力,我希望。
解决方案从版本1.5.6开始,在的 [core] 部分有一个 ignorecase .git / config
例如添加 ignorecase = true
若要将其更改为仅一个回购,请从该文件夹运行:
git config core.ignorecase true全局更改:
git config --global core.ignorecase true
I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of it's name. e.g.,:
before: File.h
after: file.h
I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes?
[edit] I suspect it is Visual Studio doing something weird with that particular file, because it seems to happen most often when I open and save it after changes. I don't have any way to fix bugs in VS however, but git should be a bit more capable I hope.
解决方案Since version 1.5.6 there is an ignorecase option available in the [core] section of .git/config
e.g. add ignorecase = true
To change it for just one repo, from that folder run:
git config core.ignorecase trueTo change it globally:
git config --global core.ignorecase true
更多推荐
如何让git忽略大小写变化?
发布评论