Information Technology Reference
In-Depth Information
How It Works
The command $ git merge a b c d creates a new commit labeled with Merge
branches 'a' , 'b' , 'c' and 'd' into the master . It will be a merge commit cre-
ated in the current branch. Its five parents will be accessible with the following n-th
parent references:
master^1
master^2
master^3
master^4
master^5
The first parent, master^1 , points to the same commit as the one pointed to in
Figure 6-14 by the master branch. The second parent, master^2 , points to the
commit pointed to in Figure 6-14 by a branch. The third parent, master^3 , points to
the commit denoted in Figure 6-14 by b branch. And so on. As you can guess, the or-
der of parents depends on the order of branches passed to by the $ git merge a b
c d command.
The merging of many branches can be undone in the same way as in Recipe 6-3 or
Recipe 6-5. You can use reflog, SHA-1 names, or n-th ancestor reference:
$ git reset --hard master^
The visual representation of the repository shown in Figure 6-14 , as printed by the $
git log command with --graph switch, is presented in Figure 6-15 .
 
Search WWH ::




Custom Search