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?

 

 

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM