Git 状态报告未跟踪的文件:
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# resource.enlighten/map/enlighten_test/.enlighten/__build_object__/geometry/land_9/processed/
nothing added to commit but untracked files present (use "git add" to track)
但是我们在索引处有这个文件:
$ git ls-tree -r HEAD |grep land_9/processed/root.pim
100644 blob 9eeca5c75dc2c945600b6e0d253a8cb8191b7e80 resource.enlighten/map/enlighten_test/.enlighten/__build_object__/geometry/land_9/processed/root.pim
我检查过这个错误出现在第一次提交后,添加了这个文件。
我试过:
- 克隆存储库。
- 清理/ checkout 文件(如 this 文章中所述)- 在 checkout 相同的未跟踪状态后。
- 将完整目录 resource.enlighten/复制到另一个 repo 并添加提交 - 没有错误。
- 运行 git fsck - 没有错误。
Git 版本 1.8.1.2。
提前感谢您的任何想法。
附言这种情况在 Git for Windows 1.8.3 中得到修复。
最佳答案
Mac 上不区分大小写是个问题。你可以试试
git config core.ignorecase true
If true, this option enables various workarounds to enable git to work better on filesystems that are not case sensitive, like FAT. For example, if a directory listing finds "makefile" when git expects "Makefile", git will assume it is really the same file, and continue to remember it as "Makefile".
关于Git 状态报告跟踪文件未跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16796198/