Git rebase order - confusion

Viewed 1848

In git-scm, they say that the supposed-to-be-merged commit is moved entirely (as a new commit) to the tip of the current branch :

So, instead of a merge operation :

enter image description here

We go with rebase :

enter image description here

Notice that C3 is kept original.

However, when I looked at git-tower, they show that the branch is not moved to the tip but to the start :

we want to integrate the changes from branch-B into branch-A, but now by using rebase.

enter image description here

After rebase :

enter image description here

Question:

What's going on here?

git-scm shows that it is moved to the tip of the branch while git-tower shows that it's not.

1 Answers

Both show the same operation: both branches are moved to the tip (not the start) of their new upstream branch.

  • experiment is moved on top of master

    git checkout experiment
    git rebase master 
    
  • branch-A is moved on top of branch-B

    git checkout branch-A
    git rebase branch-B
    

we want to integrate the changes from branch-B(!!) into branch-A,

That is what git rebase branch-B does: it replays commits from branch-A on top of branch-B, ensuring that any commit of branch-B is now part of branch-A: changes from branch-B are now into (part of the history of) branch-A.

Related