git status shows fatal: bad object HEAD

前端 未结 14 1330
醉酒成梦
醉酒成梦 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:15

    This happened to me on a old simple project without branches. I made a lot of changes and when I was done, I couldn't commit. Nothing above worked so I ended up with:

    1. Copied all the code with my latest changes to a Backup-folder.
    2. Git clone to download the latest working code along with the working .git folder.
    3. Copied my code with latest changes from the backup and replaced the cloned code (not the .git folder).
    4. git add and commit works again and I have all my recent changes.

提交回复
热议问题