gerrit - git gerrit - Use rebase instead of merge in gerrit - gerrit code review
Because of how gerrit relies on change-ids, in order to resolve conflicts (pull changes to your topic branch) the best practice is to rebase topic branch onto master/other branch you want to push to. This way you preserve the change-id without having to ammend the merge commit. For example if you submit foo to refs/for/master with history as follows:
a < foo
/
---s < master
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - gerrit tutorial - git gerrit - google gerrit - team
- Then gerrit will create a change with change-id taken from the commit a. But say after you passed review but before you submitted to master someone submitted their change:
a < foo
/
---s---x < master
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - gerrit tutorial - git gerrit - google gerrit - team
- If you rebase foo onto master you'll have
a < foo
/
---s---x < master
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - gerrit tutorial - git gerrit - google gerrit - team
- And you can easily push a again with the same change-id.