gpt4 book ai didi

git - 如何从 git 中的 "unordered stage entries in index"错误中恢复

转载 作者:太空狗 更新时间:2023-10-29 13:25:33 28 4
gpt4 key购买 nike

我刚刚将我的 git2.0.5 升级到 2.3.6,但我现在无法运行 git svn fetch 在我的一个存储库中:

$ git svn fetch
fatal: unordered stage entries in index
write-tree: command returned error: 128

git status 显示一些未跟踪的文件,但其他方面都很干净。

我找到了引入此检查的更改,摘要“read_index_from(): catch out of order entries when reading an index file”(首次出现在 2.2.0 中)和一些 mailing list discussion其中包括:

I think we have been discussing how to protect broken index file left by tools other people wrote, so I wouldn't be so surprised if our current toolset does not let you recreate certain breakages ;-)

我不记得在这个 repo 上运行过任何其他工具;除了一长串 git svn fetches 之外,它并没有做太多日常工作。 (但它已经存在了几年,所以谁知道呢。)

无论如何,我该怎么做才能从这种情况中恢复过来?我试图找到一个具有多个索引条目的路径,但没有得到任何结果:

$ git ls-files -s | cut -f 2-100 | sort | uniq -c | grep -v '^[ \t]*1 '

最佳答案

what can I do to recover from this situation?

https://stackoverflow.com/a/27481661/3161761

像这样

rm .git/index
git add -A

关于git - 如何从 git 中的 "unordered stage entries in index"错误中恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30264826/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com