我似乎有一个损坏的回购,我不知道如何修复...
$ 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.
Run Code Online (Sandbox Code Playgroud)
这是来自的输出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
Run Code Online (Sandbox Code Playgroud)
关于如何处理这个的任何想法?我基本上想要获取遥控器中的任何内容并在此基础上推送我的一些提交.
dep*_*erm 45
我遇到了同样的问题然后跑了:
git prune
git gc
Run Code Online (Sandbox Code Playgroud)
其中提到:
错误:refs/remotes/origin/ticketName的错误引用
所以我删除了引用并解决了问题:
rm .git/refs/remotes/origin/ticketName
Run Code Online (Sandbox Code Playgroud)
我认为repo被EGit或SourceTree(我并行使用)破坏了,并且与实际的哈希冲突无关.正如评论所建议的那样,我通过将遥控器克隆为新的仓库并复制我的更改来解决它.
小智 6
我有一个类似的问题,通过运行解决它:
$ git prune
Output: fatal: unable to parse object: refs/heads/prod-283
Run Code Online (Sandbox Code Playgroud)
并删除上面的参考:
$ rm -f .git/refs/heads/prod-283
Run Code Online (Sandbox Code Playgroud)
最后我能跑了 git pull