0

With the master branch checked out. Is there a difference between the order of the branches?

git merge origin/master master
git merge master origin/master

Or with local branches:

git merge master exp
git merge exp master
Halfacht
  • 924
  • 1
  • 12
  • 22

1 Answers1

0

When you have master checked out, it is totally obsolete to specify masterin the branches to be merged. It is just ignored and the result will be the same.

If you specify two branches to merge in besides the current branch, the behavior will be different, because then which commit is the 2nd and which the 3rd parent are determined by the order you specified them.

What is even worse, if you do it like git merge foo master bar, it is interpreted as old-style merge. foo is taken as commit message and only bar is merged in. This is for backwards compatibility. It should have been git merge foo bar instead, or at least git merge -m 'my message' foo master bar, but in the later form master is obsolete and ignored again.

Vampire
  • 35,631
  • 4
  • 76
  • 102