Missing dependency in Gerrit

后端 未结 3 1142
野趣味
野趣味 2021-01-06 16:34

I had four changes in Gerrit, each depending on previous one (except first, of course). I\'ve abandoned second and third and reviewed first and fourth. Since first wasn\'t d

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-06 17:10

    You need to remove the two unwanted commits corresponding to the abandoned changes from the ancestry of commit 4, i.e. the desired state is for git log to only list commits 4 and 1. When that's done, pushing a new patch set should remove the stated dependency. Getting rid of commits 2 and 3 can be done in many ways, including

    • doing an interactive rebase (git rebase -i HEAD~4 and deleting the lines for the two commits you don't want), or
    • starting a new branch based on the tip of the upstream branch and cherry-picking commit 4.

提交回复
热议问题