0

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.

Community
  • 1
  • 1
VitalyB
  • 12,397
  • 9
  • 72
  • 94
  • take a look here: http://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches – Cyprian Apr 02 '13 at 15:14
  • Not exactly the same. But... The gist of it, as I understand, is that there is no simpler way to do it, except batch/scripts? – VitalyB Apr 02 '13 at 19:42
  • This actually seems to answer my question: http://stackoverflow.com/questions/5600659/rebasing-a-branch-including-all-its-children Will check and use it to answer if it does. – VitalyB Apr 10 '13 at 13:52

0 Answers0