[Insight-developers] git process - merging in master before push to gerrit

Brad King brad.king at kitware.com
Tue Nov 23 15:43:12 EST 2010


On 11/23/2010 03:32 PM, Michael Stauffer (Circular Logic) wrote:
> A git/gerrit question. Say I'm on a topic branch for more than a few
> hours or day. I make my changes and test, then merge in from
> origin/master to test against the latest changes from master. 
> 
> Assuming my changes still work, do I then push directly from this topic
> branch to gerrit, or do I pull out my changes into a new branch based on
> the latest master so the history's a little cleaner? 
> 
> If I need to pull out my changes, what's an efficient way to do that if
> I've modified existing files, and not just added new ones? Use git patch
> and apply it to a clean branch based on the latest master?

Rebase your whole topic on the latest master:

 $ git checkout my-topic
 $ git fetch origin
 $ git rebase origin/master

Topics under review in Gerrit should have no merges.

-Brad


More information about the Insight-developers mailing list