【问题标题】:SourceTree Error: 'git status' failed with code 128: error: inflate: data stream error (incorrect header check)SourceTree 错误:“git status”失败,代码为 128:错误:inflate:数据流错误(标头检查不正确)
【发布时间】:2017-06-14 12:21:55
【问题描述】:

$ git fsck --full
error: inflate: data stream error (incorrect header check)
error: unable to unpack 06c147f2771e280dfb4758c9a83b94346993d172 header
error: inflate: data stream error (incorrect header check)
fatal: loose object 06c147f2771e280dfb4758c9a83b94346993d172 (stored in .git/objects/06/c147f2771e280dfb4758c9a83b94346993d172) is corrupt

另外,试试这个,并删除所有损坏的对象。删除对象后我写了这个命令,

$ git reset --hard
error: unable to read sha1 file of 3X/3X.Core/Resources/Resource.Designer.cs (d46f74436ae02ec61a659a8a487aee5747e2feda)
error: unable to read sha1 file of 3X/3X.Core/Resources/Resource.resx (63342162564404ccae4917489dc78ebb65075f8a)
error: unable to read sha1 file of 3X/3X.Web/Views/Job/ConfirmationAdvice.cshtml (ff39e42f5cf0e0703bd9dfe84a4b746ff91eea40)
error: unable to read sha1 file of 3X/3X.Web/Views/Job/Create.cshtml (3a97827faac6c62fd24f347dd0b0951c27c03751)
error: unable to read sha1 file of 3X/3X.Web/Views/Job/DataEntry.cshtml (89f381bafaeff53eeaf64a26d8c9608e9e86b6a1)
error: unable to read sha1 file of 3X/3X.Web/wwwroot/js/viewjs/Job/create.js (1b62c618c31add2ca28d107c1a49604492409ecf)
fatal: Could not reset index file to revision 'HEAD'.

出现上述错误

【问题讨论】:

  • 尝试从命令行执行
  • @DaniyalSyed 我试过了,但没用
  • 你在命令行遇到什么错误
  • @DaniyalSyed --> $ git fsck --full error: inflate: data stream error (incorrect header check) error: unable to unpack 06c147f2771e280dfb4758c9a83b94346993d172 header error: inflate: data stream error (incorrect header check)致命:松散对象 06c147f2771e280dfb4758c9a83b94346993d172(存储在 .git/objects/06/c147f2771e280dfb4758c9a83b94346993d172 中)已损坏 -------------------------------------------- -------------------------------------------------- ---------我删除了所有这些损坏的对象并使用“$ git reset --hard”,这将返回“致命:无法将索引文件重置为修订版'HEAD'。”

标签: git atlassian-sourcetree


【解决方案1】:

尝试删除 .git 文件夹中的索引文件

Windows 系统:

del .git\index
git reset

Linux 系统:

rm -f .git/index
git reset

如果你手动删除了索引文件,那么你需要这样做

git reset

【讨论】:

    【解决方案2】:

    它应该已损坏。尝试删除此.git/objects/06/c147f2771e280dfb4758c9a83b94346993d172

    如果您遇到与另一个对象相同的错误,请尝试删除所有这些并再次获取。

    【讨论】:

    • 我试过了,但它不起作用。你还有什么妙招吗?
    【解决方案3】:

    这是对我有用的解决方案 我打开我的服务器并转到 .git/ 并从那里下载索引文件,然后手动删除本地 .git/index 文件并用下载的索引文件替换该文件

    【讨论】:

      【解决方案4】:

      尝试了所有答案,但没有一个对我有用。

      最后发现问题在于您可能已将 Source Tree repo 配置为位于 repo_local_url/.git

      解决方案是让它指向 repo_local_url

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-06-18
        • 2013-03-06
        • 2010-12-31
        • 2013-03-19
        • 2011-11-13
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多