I rebased only a branch. Is it possible to move the others as well?

Viewed 32

I was working with a repo where both origin/master and master were in the same commit. I created several branches one on top of the other. Something like

master--> branchDothis---> branchDothat--->branchDothistoo

some other member of the team advanced the master branch in the repo so after git fetch origin master I had master and origin/master in different commits.

So I was at branch branchDothistoo and I did git rebase origin/master

now I have

master---> origin/master-----> branchDothistoo

so the other two branches are not rebased. (but their commits are there) Is there any way to make them be in the line of commits from origin/master to branchDothistoo?

1 Answers

Yes. Depending on if the other branches have new commits:

  1. If the other branches have new commits of their own, simply check each one out and git rebase origin/master.
  2. If the other branches don't have new commits of their own, while on a branch you wish to duplicate, you can just re-create the others with git branch -f branchDothis, etc. for each branch. Note you could delete them and recreate them, or use the -f flag which mean "force create even if it already exists". The end result is the same.
Related