首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >git致命:发现SHA1冲突

git致命:发现SHA1冲突
EN

Stack Overflow用户
提问于 2014-05-31 06:05:52
回答 3查看 18.6K关注 0票数 21

我似乎有一个损坏的回购,我不知道如何修复...

$ git pull
remote: Counting objects: 141, done.
remote: Compressing objects: 100% (90/90), done.
error: unable to unpack ff7fca002656ad848c44bf134088d638a01d5217 header
error: inflateEnd: stream consistency error (no message)
fatal: SHA1 COLLISION FOUND WITH ff7fca002656ad848c44bf134088d638a01d5217 !
fatal: index-pack failed
Unable to write to standard output: The pipe is being closed.

这是fsck的输出

$ git fsck
error: unable to unpack 024e257c1a13532e7d5579b0ea4bb5915d21e4a6 header
error: inflateEnd: stream consistency error (no message)
fatal: loose object 024e257c1a13532e7d5579b0ea4bb5915d21e4a6 (stored in super/sectet/path/to/repo/.git/objects/02/4e257c1a13532e7d5579b0ea4bb5915d21e4a6) is corrupt

你有什么想法来解决这个问题吗?我基本上想要得到遥控器中的任何东西,并在此之上推送我的几个提交。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-06-01 18:43:54

我认为存储库被EGit或SourceTree (我并行使用)损坏了,实际上与散列冲突无关。正如评论所建议的那样,我通过克隆遥控器作为新的存储库,并复制我的更改来解决它。

票数 8
EN

Stack Overflow用户

发布于 2017-02-01 12:08:04

我有一个类似的问题,并通过运行以下命令解决了它:

$ git prune
Output: fatal: unable to parse object: refs/heads/prod-283

只需删除上面的引用:

$ rm -f .git/refs/heads/prod-283

我终于可以运行git pull

票数 6
EN

Stack Overflow用户

发布于 2018-07-06 14:44:08

我运行了以下commnads:

git prune
git gc 

并删除了文件.git\refs\remotes\origin\master (在错误:错误引用中列出的文件)

和范围

git gc --prune=now

解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23964033

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档