@@ -4004,27 +4004,26 @@ to see what the top commit was.
4004
4004
Merging multiple trees
4005
4005
----------------------
4006
4006
4007
- Git helps you do a three-way merge, which you can expand to n-way by
4008
- repeating the merge procedure arbitrary times until you finally
4009
- "commit" the state . The normal situation is that you'd only do one
4010
- three-way merge ( two parents), and commit it , but if you like to, you
4011
- can do multiple parents in one go.
4007
+ Git can help you perform a three-way merge, which can in turn be
4008
+ used for a many-way merge by repeating the merge procedure several
4009
+ times . The usual situation is that you only do one three-way merge
4010
+ (reconciling two lines of history) and commit the result , but if
4011
+ you like to, you can merge several branches in one go.
4012
4012
4013
- To do a three-way merge, you need the two sets of "commit" objects
4014
- that you want to merge, use those to find the closest common parent (a
4015
- third "commit" object), and then use those commit objects to find the
4016
- state of the directory ("tree" object) at these points.
4013
+ To perform a three-way merge, you start with the two commits you
4014
+ want to merge, find their closest common parent (a third commit),
4015
+ and compare the trees corresponding to these three commits.
4017
4016
4018
- To get the "base" for the merge, you first look up the common parent
4019
- of two commits with
4017
+ To get the "base" for the merge, look up the common parent of two
4018
+ commits:
4020
4019
4021
4020
-------------------------------------------------
4022
4021
$ git merge-base <commit1> <commit2>
4023
4022
-------------------------------------------------
4024
4023
4025
- which will return you the commit they are both based on. You should
4026
- now look up the " tree" objects of those commits, which you can easily
4027
- do with (for example)
4024
+ This prints the name of a commit they are both based on. You should
4025
+ now look up the tree objects of those commits, which you can easily
4026
+ do with
4028
4027
4029
4028
-------------------------------------------------
4030
4029
$ git cat-file commit <commitname> | head -1
0 commit comments