git repo 已损坏,无法状态为 : "BUG: fsmonitor.c:21: fsmonitor_dirty has more entries than the index"

标签 git corruption

问题的第一个迹象:

❯ 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

关于git repo 已损坏,无法状态为 : "BUG: fsmonitor.c:21: fsmonitor_dirty has more entries than the index",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73044253/

相关文章:

git - 如何 merge Git LFS 跟踪的文件内容

Git post-receive - 如何检查推送的分支是否与主分支 merge

linux - NFS - 来自两个客户端文件损坏的 mv 命令?

git - 如何修复 git 存储库中的 "bad date"问题?

c++ - 跟踪生产 Linux 服务器上的内存损坏

java - Eclipse自动构建Android项目很糟糕

git - 我如何告诉 git 忽略以波浪号开头的文件?

git - 是否有适用于 Mac OS X 的良好 git 客户端,它具有 Conerstone 的所有功能或 Subversion 的版本?

git - git 未跟踪文件后保留本地更改防止 merge

c - 我的 C 数组在执行期间损坏