Reputation: 57
While doing git rebase master branch_a
, the commit that are coming from other branch are also included in my branch. I started with original branch state as seen below
after that, I executed rebase using git rebase master branch_a
and then this happens
I thought rebase will move the commit E
root to I
. is there problem with how I perform rebase?
UPDATE : I wrongly type the command, I used git rebase master branch_a
Upvotes: 2
Views: 225
Reputation: 59923
The problem is in the command you ran:
git rebase branch_a master
This form means "checkout master
and rebase it on top of branch_a
".
From the documentation of git rebase
:
git rebase master topic
[...] [this] form is just a short-hand of
git checkout topic
followed bygit rebase master
. When rebase exits topic will remain the checked-out branch.
What you're looking for is:
git rebase master branch_a
which means "checkout branch_a
and rebase it on top of master
".
Upvotes: 1