问题的第一个迹象:
❯ git rebase -r master
BUG: fsmonitor.c:21: fsmonitor_dirty has more entries than the index (179457 > 1040)
zsh: abort git rebase -r master
在这种状态下“卡住”,不知道如何恢复或重现:
❯ git status
BUG: fsmonitor.c:21: fsmonitor_dirty has more entries than the index (179457 > 1040)
error: git died of signal 6
❯ git log # works
❯ git diff head~
error: git died of signal 6
BUG: fsmonitor.c:21: fsmonitor_dirty has more entries than the index (179457 > 1040)
❯ git diff head~..head~~ # works
❯ git checkout head
BUG: fsmonitor.c:21: fsmonitor_dirty has more entries than the index (179457 > 1040)
zsh: abort git checkout head
结果 git 的索引在 rebase 过程中被损坏了。
来自:https://git.seveas.net/repairing-and-recovering-broken-git-repositories.html
mkdir .git/my_backup
mv .git/sharedindex.* .git/my_backup
mv .git/index .git/my_backup
git reset --mixed # rebuild index
更新:
可能相关的 git 邮件列表线程:
疑似罪魁祸首正在设置配置
core.splitIndex
以及core.fsmonitor
(和/或可能是feature.manyFiles
)。
虽然它可能已在2.4.1中修复:https://github.com/git/git/commit/3704fed5eae8ca2fa20bcf6adb277ee83b012ce0