Git“错误的sha1文件”错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39475/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git "bad sha1 file" error
提问by Artem Tikhomirov
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error?
您好,我遇到了 git-fsck 的以下错误,即使在 --aggressive 模式下,git-gc 也无法清除该错误。接下来我该怎么做才能修复此存储库错误?
$ git-fsck
bad sha1 file: .git/objects/55/tmp_obj_a07724
采纳答案by Jordi Bunster
It's not a simple answer, sadly. But this might help:
遗憾的是,这不是一个简单的答案。但这可能会有所帮助:
Recovering from repository corruption(from the Git's user manual).
从存储库损坏中恢复(来自 Git 的用户手册)。
回答by Damien Diederen
Err... tmp_obj_a07724suspiciously looks like a leftover temporary
file :)
呃......tmp_obj_a07724可疑地看起来像一个剩余的临时文件:)
What happens if you simply move it away from the .gitdirectory
(after a backup of the whole thing)?
如果您只是将它从.git目录中移开(在备份整个内容之后)会发生什么?
回答by Sergei
From man git-fsck:
来自man git-fsck:
Any corrupt objects you will have to find in backups or other archives
(i.e., you can just remove them and do an rsync with some other site in
the hopes that somebody else has the object you have corrupted).

