I'm using SourceTree 1.9.10.0 on Windows 10 and I wan't to rebase my feature branch EUR-1058 onto master. I do it like this:
This results in the following tree:
And If I do a pull an automatic merge happens:
Why is this happening? Is it due to the fact that the commit "Mailcheck rewrite" was on my laptop and I'm now rebaseing from my desktop and the SHA-1 hashes has somehow changed or something similar?



When you rebased your
EUR-1058branch onmaster, you rewrote the history of that branch. Consider the following diagram illustrating the point:Rebasing
EUR-1058onmastermeans doing the following steps:master, in this case commitBmasteron top ofB, in this case replaying commitsCandDEUR-1058since commitB, i.e. commitsEandFAfter rebasing, the diagram looks like this:
Note that I have labelled
E'andF', to indicate that these are in fact new commits, which were made during the rebase.Now to answer your actual question, when you tried to do a
git pullonEUR-1058, Git first checked to see if your local branch could be fast-forwarded by what is on the remote (or inorigin/EUR-1058). In this case, no fast-forward was possible. Git views the remote branch at this point as being totally different than what you have locally. Hence, it completed the pull by making a merge commit.What you probably should have done is to force push your rebased
EUR-1058branch to the remote after completing the rebase via:Using force is necessary here because the history/base of the branch has changed. This is the same reason why you ended up with a merge commit. After the force push, you can continue life as normal.
As a word of caution, you should realize that rewriting the history of
EUR-1058can cause problems for anyone sharing this branch. So, it should be done carefully.