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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:45:02  来源:igfitidea点击:

Git error: inflate: data stream error (unknown compression method)

gitbitbucket

提问by lsergeev

I am getting Git error: inflate: data stream error (unknown compression method) fatal: failed to read object <hach>: Invalid argument errorwhen 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

  1. Do a git fsck --full
  2. Did it report a corrupted file?
  3. If so delete the file, go back to step #1.
  4. Do del .git/index
  5. Do git reset
  1. 做一个 git fsck --full
  2. 它是否报告了损坏的文件?
  3. 如果是这样,请删除该文件,返回到步骤 #1。
  4. del .git/index
  5. git reset

回答by Mohsen Jalalian

I think it happened because maybe your computer or files were corrupted.

我认为这可能是因为您的计算机或文件已损坏。

First back up your .gitfolder, then use git fsck --fullcommand to check your file system then delete corrupt files and check it again until your problem disappear

首先备份您的.git文件夹,然后使用git fsck --full命令检查您的文件系统,然后删除损坏的文件并再次检查,直到您的问题消失