Git 状态报告跟踪文件未跟踪

标签 git

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

我检查过这个错误出现在第一次提交后,添加了这个文件。

我试过:

  1. 克隆存储库。
  2. 清理/ checkout 文件(如 this 文章中所述)- 在 checkout 相同的未跟踪状态后。
  3. 将完整目录 resource.enlighten/复制到另一个 repo 并添加提交 - 没有错误。
  4. 运行 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/

相关文章:

git - 声音、视频和其他二进制文件的版本控制

gitolite - 如何克隆并推送到在 "user"文件夹下创建的 repo

Git 从别人的 fork 中 merge

python - GitHub API : Enable Push Restrictions for branch

git - 从 Jenkins,如何访问 GitBlit 中的安全存储库(通过 http(s))?

git - 我如何获取我不拥有的未 merge 的 pull 请求?

Git 从 TeamCity 9.0.3 构建推送

git - 永久存储 SSH key 密码

git - 去除悬挂 Blob 的最安全方法是什么

git - 无法删除git中的远程分支