tags:

views:

97

answers:

1
+4  Q: 

Git merge command

I'm reading the following article: http://github.com/guides/keeping-a-git-fork-in-sync-with-the-forked-repo, where they mention essentially pulling in changes from two repos at the same time by creating the following alias:

pu = !"git fetch origin -v; git fetch wycats -v; git merge wycats/master"

This makes sense, but, as someone new to Git, I'm curious why the commands is that versus:

pu = !"git fetch origin -v; git merge origin/master; git fetch wycats -v; git merge wycats/master"

or something along those lines. Basically, I'm wondering why the argument to merge is wycats/master and how it knows about origin/master automatically. Looking for a quick explanation.

+2  A: 

I am at a loss as to why an octopus merge would take place here (msysgit1.6.5 in a DOS session).
An octopus is for one merge with several parents.

If I follow the routine of "two modifications in to remote repo to pull back", hare is what I see before the final merge (after one round of pulling):

alt text

chgB (from main, that is "origin") and chgA (from remote "mainA") have been merge one by one in master.

Two other changes has been made and fetched: chgB2 from origin and chgA2 from mainA.

If I try to only merge mainA/master, I ends up with:

alt text

chgA2 has been merged. chgB2 from "main" (origin) is still hanging out there...

But if I try one more change in mainA, and specify both remote repos in the merge command, then an octopus merge takes place:

C:\Prog\Git\tests\octo\dest1>git merge origin/master mainA/master
Trying simple merge with 9e3e16d8e75cec3be621c47fb72e955cc2574f0f
Trying simple merge with 4dfb282a31d5bafddb244c84b66ede41e28f1042
Merge made by octopus.
 a.txt |    2 +-
 b.txt |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

alt text

VonC