git status shows fatal: bad object HEAD

前端 未结 14 1362
醉酒成梦
醉酒成梦 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 00:58

    I managed to fix a similar problem to this when some of git's files were corrupted:

    https://stackoverflow.com/a/30871926/1737957

    In my answer on that question, look for the part where I had the same error message as here:

    fatal: bad object HEAD.
    

    You could try following what I did from that point on. Make sure to back up the whole folder first.

    Of course, your repository might be corrupted in a completely different way, and what I did won't solve your problem. But it might give you some ideas! Git internals seem like magic, but it's really just a bunch of files which can be edited, moved, deleted the same as any others. Once you have a good idea of what they do and how they fit together you have a good chance of success.

提交回复
热议问题