2012-09-26 36 views
1

我早上开始git pull,就像任何其他的早晨:在git的拉动,“无法解决参考”和“未定义的错误:0”

$ git pull 
error: unable to resolve reference refs/remotes/origin/card-declined: Undefined error: 0 
From github.com:instaedu/instaedu 
! [new branch]  card-declined -> origin/card-declined (unable to update local ref) 

(FYI,“卡拒绝”的一个分支我就在昨天晚上推到GitHub上,从那以后一直没有任何活动)

我以前从来没有见过的错误,所以我看着它,发现了这个问题:git pull fails “unalble to resolve reference” “unable to update local ref”。得票最多的答案了,说要试运行git gc --prune=now,所以我这样做:

$ git gc --prune=now 
error: bad ref for refs/remotes/origin/card-declined 
error: bad ref for refs/remotes/origin/card-declined 
fatal: loose object b28488de1ef3f6887eef99c0316a654d1803e6af (stored in .git/objects/b2/8488de1ef3f6887eef99c0316a654d1803e6af) is corrupt 
error: failed to run repack 

它似乎没有任何修复,但现在我看到的东西似乎从昨天起已被损坏。

任何想法如何解决这个问题?

+0

也许是一个新鲜的'git clone'?它看起来像你的回购是腐败...... – nneonneo

+0

@nneonneo这可能是我最终做的,但我仍然好奇,看看它是否可以先修复。 –

+0

可能重复[git pull失败“无法解析引用”“无法更新本地ref”](http://stackoverflow.com/questions/2998832/git-pull-fails-unable-to-resolve-reference-unable -to-更新本地-REF) – Lucio

回答

3

尽管我重新克隆了存储库,因此我可以继续工作,但我确实保留了旧的已损坏的存储库,以防偶然找到解决该问题的方法。不幸的是,我发现没有这样的修复。

如果遇到这个问题,最好的办法就是再次登录git clone。希望在repo被损坏之前,你已经将最新的更改推送到远程。

0

我通过删除坏裁判解决这个问题,例如:

del .git\refs\remotes\origin\card-declined 
del .git\refs\remotes\origin\card-declined 

它主要是一种预感,但它似乎已经奏效,因为我不关心麻烦裁判。