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
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
$