Strange behaviour of Git: mysterious changes cannot be undone

不想你离开。 提交于 2019-11-28 20:34:41

The Linux source tree has filenames which differ in case only, which causes interesting failures on systems with case-insensitive filesystems.

You need a case-sensitive filesystem in order to work with the Linux source.

(include/linux/netfilter/xt_connmark.h and include/linux/netfilter/xt_CONNMARK.h are two different files in the Git repository, but only one can exist in your checkout at a time if your filesystem is case-insensitive.)

Try updating submodules. I've gotten some weird, somewhat similar issues when a submodule included in a repository has been updated. Doing git submodule update may do the trick.

As @ephemient said, this is because case insensitive file system. And I guess you are using Mac's HFS?

For a simple solution on Mac, you can create a disk image, format the disk image with 'Case-sensitive Journaled HFS+':

hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/git.dmg

Then mount the disk image by open ~/git.dmg.

And then do all git clone, git checkout operations in the mountable volumes.


Or you need some third-party tool to convert HFS+ from case insensitive to case sensitive. As I know, some Mac Apps are made on case insensitive file systems, so some of them may failed to work if you do this convertion.

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