Muhammad Umer
Muhammad Umer

Reputation: 18097

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

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*

Upvotes: 7

Views: 10598

Answers (2)

Mad Physicist
Mad Physicist

Reputation: 114230

Just rebase your branch onto master:

git checkout my-branch
git rebase master

Upvotes: 12

LF-DevJourney
LF-DevJourney

Reputation: 28529

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

Upvotes: 0

Related Questions