git status shows fatal: bad object HEAD

前端 未结 14 1262
醉酒成梦
醉酒成梦 2020-12-09 00:44

I have a problem with git on Windows Azure. Git status shows - \"fatal: bad object HEAD\" and I tried running:

 git fsck --full
 git gc

But

相关标签:
14条回答
  • 2020-12-09 01:18

    Make a copy of your git dir in your local host and run git init there once again. Push the project to a brand new reprository.

    0 讨论(0)
  • 2020-12-09 01:22

    Your repository is corrupt. That means data is lost that cannot be recovered by git itself. If you have another clone of this repository, you can recover the objects from there, or make a new clone.

    fatal: bad object HEAD means the branch referenced from HEAD is pointing to a bad commit object, which can mean it's missing or corrupt.

    From the output of git fsck, you can see there are a few tree, blob and commit objects missing.

    Note that using git itself is not enough to keep data safe. You still need to back it up in cases of corruption.

    0 讨论(0)
提交回复
热议问题