I use the later mainly just because it looks slightly more readable
I'm surprised by this question simply because if you've been doing this, you should by now have been able to see that it isn't doing what you expect.
Your command is not interpreted as git merge <remote> <branch>
; that is not a recognized merge syntax. merge
is not one of the commands that interacts with a remote.
Rather it is git merge <branch1> <branch2>
Here <branch1>
is origin
. Assuming you don't have a ref named origin
but do have a remote configuration named origin
, this will be interpreted as "the default branch of origin
. Assuming you have a ref named remotes/origin/HEAD
(you can look for what this is with git branch -a |grep HEAD
or something like that), that's the default branch of origin
.
So what you're doing is an octopus merge, incorporating
- Either a ref named
origin
or, more likely, the default branch of the origin
remote - which is likely origin/master
, AND
- A local ref named
otherbranch
into the current branch (into which your previous pull
command had merged origin/mybranch
).
The circumstances where that would look anything like merging the from the remote reef origin/otherbranch
into the current branch are narrow and mostly trivial. The circumstances where it would generated an error and the merge would fail are numerous.
I don't mean any offense, but I sincerely believe that if you put so much value on tweaking the syntax to look "slightly more readable" to you, then the command line may not be the interface for you.