How to handle git gc fatal: bad object refs/remotes/origin/HEAD error?

后端 未结 8 1457
庸人自扰
庸人自扰 2021-01-30 02:36

I randomly hit this today while trying to run Git garbage collect:

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


        
8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 03:27

    When all other answers fail, just restart your computer.

    I encountered OP's error and also had Permission denied on some .gitattribute file in unrelated directory (no matter if run by admin or not). This helped me.

提交回复
热议问题