我设法让我的索引处于某些文件未按预期跟踪的状态。git未检测到某些文件中的更改
作为一个例子,我有size.h并在工作目录test.h不变:
$ git-ls-files -st size.h test.h
H 100644 de2c741b07d86f92bdd660626848072cb2bf510f 0 size.h
H 100644 8bb24bc7483ffcfc0fc1a3761dc63e86a1b3e003 0 test.h
$ git status
# On branch master
nothing to commit (working directory clean)
然后我做了一些随机改变这两个文件:
$ fortune >> size.h
$ fortune >> test.h
出于某种原因大小.h没有修改(虽然文件很清楚)。
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: test.h
#
no changes added to commit (use "git add" and/or "git commit -a")
删除索引并重置后,一切都恢复正常了:同时按预期test.h被修改
$ rm .git/index
$ git reset
Unstaged changes after reset:
M size.h
M test.h
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: size.h
# modified: test.h
#
no changes added to commit (use "git add" and/or "git commit -a")
我一直在CentOS和工作与GIT 1.6.6 msysgit 1.6.5.1在Windows上通过这个存储库上的samba出现奇怪之前。我无法从新的克隆中重现这一点。
我的直觉是,这是msysgit中的一个错误,也许与samba结合使用。有任何想法吗?