Let's say that I want to do a non-fast-forward merge (a "real merge" and definitely not a rebase) of a branch featureBranch
into a branch master
. For the sake of simplicity please assume that there are no remote repositories (there is only 1 local repository), and this is the output of git checkout featureBranch && git log
:
Switched to branch 'featureBranch'
commit 486b01a6db4597a8f02c9f23a16ddaa2d0e18392
Author: xxx <xxx@xxx.com>
Date: Mon Sep 28 21:02:00 2015 +0100
C
commit 39fde8a6ccd27ad8e5b815f5462ae6267df2e213
Author: xxx <xxx@xxx.com>
Date: Mon Sep 28 21:00:34 2015 +0100
A
And this is the output of git checkout master && git log
:
Switched to branch 'master'
commit 903ad86a4395f004dd2f28009b11f93d4c056d0b
Author: xxx <xxx@xxx.com>
Date: Mon Sep 28 21:00:54 2015 +0100
B
commit 39fde8a6ccd27ad8e5b815f5462ae6267df2e213
Author: xxx <xxx@xxx.com>
Date: Mon Sep 28 21:00:34 2015 +0100
A
Is the right way of carrying out the merge like this:
git checkout master && git merge featureBranch
or like that:
git checkout featureBranch && git merge master
Please note this is not a duplicate of this SO question, which is about a fast-forward merge.