Git merge team

I read the following article: http://github.com/guides/keeping-a-git-fork-in-sync-with-the-forked-repo , where they mention essentially pulling changes from two repositories while creating the following nickname:

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

This makes sense, but as someone new to Git, I am curious why the commands are as follows:

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

or something like that. Basically, I wonder why the merge argument is wycats / master and how it knows about origin / master automatically. Look for a brief explanation.

+4
source share
1 answer

I do not understand why the octopus merges here (msysgit1.6.5 in a DOS session).
Octopus for a single merger with multiple parents.

If I follow the โ€œtwo modifications in the remote repo to backtrackโ€ routine, this is what I see before the final merge (pull after one round):

alt text

chgB (from the main, that is, the "source") and chgA (from the remote " mainA ") are combined one after another in master .

Two other changes were made and received: chgB2 from the source and chgA2 from mainA .

If I try to merge only mainA/master , I get:

alt text

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

But if I try one more change in mainA and mainA both remote repositories in the merge command, the trenches merge:

 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

+2
source

Source: https://habr.com/ru/post/1304004/


All Articles