Git 错误:inflate:数据流错误(未知压缩方式)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41741683/
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 error: inflate: data stream error (unknown compression method)
提问by lsergeev
I am getting
Git error: inflate: data stream error (unknown compression method) fatal: failed to read object <hach>: Invalid argument error
when I try do $ git status
. How can I fix it?
Git error: inflate: data stream error (unknown compression method) fatal: failed to read object <hach>: Invalid argument error
当我尝试 do 时,我得到了
$ git status
。我该如何解决?
回答by ozba
- Do a
git fsck --full
- Did it report a corrupted file?
- If so delete the file, go back to step #1.
- Do
del .git/index
- Do
git reset
- 做一个
git fsck --full
- 它是否报告了损坏的文件?
- 如果是这样,请删除该文件,返回到步骤 #1。
- 做
del .git/index
- 做
git reset
回答by Mohsen Jalalian
I think it happened because maybe your computer or files were corrupted.
我认为这可能是因为您的计算机或文件已损坏。
First back up your .git
folder, then use git fsck --full
command to check your file system then delete corrupt files and check it again until your problem disappear
首先备份您的.git
文件夹,然后使用git fsck --full
命令检查您的文件系统,然后删除损坏的文件并再次检查,直到您的问题消失