Git repository corrupt (incorrect header check; loose object is corrupt)

后端 未结 3 1262
抹茶落季
抹茶落季 2020-12-04 20:45

I experienced a power failure yesterday evening while writing a commit message. When I booted the machine back up I couldn\'t complete the commit. I ran git reset

3条回答
  •  情歌与酒
    2020-12-04 21:26

    As described in this answer I ran:

    git reflog expire --expire-unreachable=now --all
    git gc --prune=now
    

    Which removed all of my dangling blobs and dangling commits, as well as the corrupt db objects.

    It was a lot faster than tracking them down one-by-one!

提交回复
热议问题