michael nesterenko
michael nesterenko

Reputation: 14449

gerrit rebase review branch on latest changes from upstream branch

Is it possible to rebase topic branch with some changes pending review on upstream? I want to preserve all review comments, etc. but also have latest changes made in upstream.

I thought about following workflow (not sure if it works):

The same, but in git commands (everything is done on local topic branch):

Will this schema work?

Upvotes: 6

Views: 5301

Answers (1)

Brad
Brad

Reputation: 5532

Sure it is fairly easy to put some topic branch changes on top of other upstream changes which are pending in Gerrit. The workflow I typically use:

  • Download the upstream changes you want as a parent. You typically don't want to create a new patchset for these changes, so I use the 'git checkout' command which can be copy-pasted from Gerrit. With the other commands (pull and cherry-pick), you will create a new commit if there has been other development since the upstream change was uploaded.
  • Cherry-pick the change you want to be on top of the upstream change(s) you just pulled down. Copy-paste the git cherry-pick command from gerrit
  • Upload to gerrit via git push <server> HEAD:refs/for/<topicBranch>

Upvotes: 0

Related Questions