1
o----o----o----o----o-----o----o----o origin/master
          \          \I---F---J   branch 2
           \A--B--C    branch 1

My goal is to introduce features from branch 1 into branch 2 and make branch2 up-to-date by rebasing on origin/master

What I'm doing is

checkout branch1
rebase origin/master
checkout branch2
rebase branch1

That's not too hard. But I thought that it would be so if I had many feature branches that I wanted to introduce changes from. Is there any better way to do such "chained rebases"?

DimG
  • 1,641
  • 1
  • 16
  • 23
  • possible duplicate of [Git: How to rebase many branches (with the same base commit) at once?](http://stackoverflow.com/questions/866218/git-how-to-rebase-many-branches-with-the-same-base-commit-at-once) – Sébastien Dawans Sep 22 '15 at 11:16

1 Answers1

1

I don't believe there is a way to do a long chain of rebases all at once. But you can do a little bit better than you are doing. You don't need the git checkouts:

git rebase foo_branch bar_branch

is the same as

git checkout bar_branch
git rebase foo_branch
jwg
  • 5,547
  • 3
  • 43
  • 57