How can I recover my Git repository for a “missing tree” error?

前端 未结 14 2149
孤独总比滥情好
孤独总比滥情好 2020-12-08 02:23

We are using Gerrit for our Git repository. On a project that has been active for several months, we are suddenly unable to push any changes. When we execute git pus

相关标签:
14条回答
  • 2020-12-08 03:23

    When we get this, I can almost always fix it with a git gc:

    git gc --aggressive --prune=now
    

    back up your git repo first!

    0 讨论(0)
  • 2020-12-08 03:26

    Technically this answer's a little late, but what worked for me was to create a patch for the changeset I was trying to push, recloned the repository to another disk location, Applied the patch, recommitted, and pushed.

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