[Development] Pushing rebases and unrelated changes together is a sin

Thiago Macieira thiago.macieira at intel.com
Wed Feb 20 09:22:31 CET 2013


On quarta-feira, 20 de fevereiro de 2013 08.47.40, Samuel Rødal wrote:
> The correct process when doing rebases is:
> 
> git pull --rebase # or your favorite git work-flow
> git push gerrit HEAD:refs/for/some_branch
> # add comment in change on gerrit about being a pure rebase
> # do some changes
> git commit -a --amend
> git push gerrit HEAD:refs/for/some_branch

Actually, I'll go further: the above should be done ONLY if you are trying to 
solve a conflict. If you're not trying to solve a conflict, DON'T REBASE.

If you rebase your branch often, like I do, then never push an update from the 
actual branch. Instead, check out the old base for the commit, cherry-pick the 
new commit, and push that.

You can get the old base for the commit from the Gerrit interface. It lists 
the SHA-1 of the previous commits, so it's just that plus ~.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130220/34a5c0b5/attachment.sig>


More information about the Development mailing list