So let's say I have this branch structure (hashes are made up):
master <- ecdf4b40 <- branch1 <- branch2 <- d671270e <- branch3
Now let's also say master
is no longer in sync with origin/master
, so I have to rebase all those sequential branches.
What I do now is just rebasing the topmost branch, like this:
git branch branch3-bkp branch3
git checkout branch3
git fetch
git rebase origin/master
Then I compare the output of git log branch3-bkp --oneline --decorate
to git log branch3 --oneline --decorate
, and then move branches in the middle (in this case branch1
and branch2
) with git branch -f <branch-name> <hash-to-point-it-to>
.
Is there an automatic way of rebasing all those sequential branches without having to move all inner pointers by hand (and without having to do one rebase per branch)?