Improve section "Merging multiple trees"

Remove unnecessary quoting.
Simplify description of three-way merge.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Thomas Ackermann 2013-08-27 20:03:09 +02:00 committed by Junio C Hamano
parent df47da758e
commit e8e9964de4
1 changed files with 13 additions and 14 deletions

View File

@ -4004,27 +4004,26 @@ to see what the top commit was.
Merging multiple trees Merging multiple trees
---------------------- ----------------------


Git helps you do a three-way merge, which you can expand to n-way by Git can help you perform a three-way merge, which can in turn be
repeating the merge procedure arbitrary times until you finally used for a many-way merge by repeating the merge procedure several
"commit" the state. The normal situation is that you'd only do one times. The usual situation is that you only do one three-way merge
three-way merge (two parents), and commit it, but if you like to, you (reconciling two lines of history) and commit the result, but if
can do multiple parents in one go. you like to, you can merge several branches in one go.


To do a three-way merge, you need the two sets of "commit" objects To perform a three-way merge, you start with the two commits you
that you want to merge, use those to find the closest common parent (a want to merge, find their closest common parent (a third commit),
third "commit" object), and then use those commit objects to find the and compare the trees corresponding to these three commits.
state of the directory ("tree" object) at these points.


To get the "base" for the merge, you first look up the common parent To get the "base" for the merge, look up the common parent of two
of two commits with commits:


------------------------------------------------- -------------------------------------------------
$ git merge-base <commit1> <commit2> $ git merge-base <commit1> <commit2>
------------------------------------------------- -------------------------------------------------


which will return you the commit they are both based on. You should This prints the name of a commit they are both based on. You should
now look up the "tree" objects of those commits, which you can easily now look up the tree objects of those commits, which you can easily
do with (for example) do with


------------------------------------------------- -------------------------------------------------
$ git cat-file commit <commitname> | head -1 $ git cat-file commit <commitname> | head -1