bad object refs/remotes/origin/HEAD

How to handle git gc fatal: bad object refs/remotes/origin/HEAD error: failed to run repack

I randomly hit list today while trying to garbage collect.

$ git gc
fatal: bad object refs/remotes/origin/HEAD
error: failed to run repack

How do I deal with this?

 

 
 https://stackoverflow.com/a/38192799/3782855

I don't understand the ramifications分支 of this, but as suggested in this thread, when I encountered this I just did

$ mv .git/refs/remotes/origin/HEAD /tmp

(keeping it around just in case) and then

$ git gc

worked without complaining; I haven't run into any problems.

 

问题原因应该是,添加了新的remote,但是没有git for windows没有移除后台的origin?

 

 

 

 

 

 

posted @ 2019-09-11 12:41  ChuckLu  阅读(3156)  评论(0编辑  收藏  举报