python152 python152 - 1 month ago 19
Git Question

git rebase using sourcetree

I think I am confused on how to use SourceTree GUI to do git rebase. I have two branches "master" and "dev". As seen, the two branch diverged. I want to do a rebase on "dev" branch, using command line, this would be:

git checkout dev
git rebase master


enter image description here

I would have expected to right click "dev", and choose "Rebase current changes onto dev". I assume current changes means "new commits on master". But picking this option seems have no effect whatsoever. What would be the correct steps?

Answer

But picking this option seems have no effect whatsoever.

Yes, because current changes are the one of the current branches, which is dev.

Rebasing dev on top of dev means an no-op.

git checkout dev
git rebase master

That means: current branch is dev: to be rebased on top of master.

So in SourceTree, you need to right-click on master (while dev is checked out), and select:

Rebase current changes onto master
Comments