How to rebase master branch into current branch but behind it?

Viewed 1629

Suppose branches look like this

master: A B C D*
           \  
my-branch:  E F G H*

I want it to look like this

master: A B C D*
               \
my-branch:      E F G H*
2 Answers

Just rebase your branch onto master:

git checkout my-branch
git rebase master

Rebase master on your branch, then merge your branch into master.

git checkout my-branch
git rebase master
git checkout master
git merge my-branch
Related