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

前端 未结 14 2196
孤独总比滥情好
孤独总比滥情好 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:04

    Try a git pull --rebase.

    I saved the diff (git show > ~/mychanges.txt, took out the commit msg at the top of the file). The checked out a new branch (git checkout -b newbranch) applied the changes (git apply ~/mychanges.txt), and then did a git pull --rebase. Then everything worked.

提交回复
热议问题