UPDATE
This answers my question: Rebasing a branch including all its children
Original question below
Consider the following log graph:
A---B---C origin/master
\
D---E---F master
\
\ E---F topic1
G---H---I topic2
As shown, I have a master, on which I did some work. I also started to work on 2 topic, after commit F on master.
At this point, I decide I'd like to fetch the recent updates git fetch
and now my graph looks like that:
A---B---C---1---2---3 origin/master
\
D---E---F master
\
\ E---F topic1
G---H---I topic2
I'd like to merge/rebase all those new changes to both master, topic1, and topic2 in the most painless way (since I am really just trying to keep them up-to-date). It should look like so:
A---B---C---1---2---3 origin/master
\
D---E---F master
\
\ E---F topic1
G---H---I topic2
What should I be doing? The way I see is doing
$git checkout master
$git rebase origin/master
$git checkout topic1
$git rebase master
$git checkout topic2
$git rebase master
Is there a simpler way to do it? It seems to be like quite a common task.