@@ -9,7 +9,8 @@ git-merge-base - Find as good common ancestors as possible for a merge
9
9
SYNOPSIS
10
10
--------
11
11
[verse]
12
- 'git merge-base' [-a|--all] [--octopus] <commit> <commit>...
12
+ 'git merge-base' [-a|--all] <commit> <commit>...
13
+ 'git merge-base' [-a|--all] --octopus <commit>...
13
14
'git merge-base' --independent <commit>...
14
15
15
16
DESCRIPTION
@@ -22,23 +23,21 @@ that does not have any better common ancestor is a 'best common
22
23
ancestor', i.e. a 'merge base'. Note that there can be more than one
23
24
merge base for a pair of commits.
24
25
25
- Unless `--octopus` is given, among the two commits to compute the merge
26
- base from, one is specified by the first commit argument on the command
27
- line; the other commit is a (possibly hypothetical) commit that is a merge
28
- across all the remaining commits on the command line. As the most common
29
- special case, specifying only two commits on the command line means
30
- computing the merge base between the given two commits.
26
+ OPERATION MODE
27
+ --------------
28
+
29
+ As the most common special case, specifying only two commits on the
30
+ command line means computing the merge base between the given two commits.
31
+
32
+ More generally, among the two commits to compute the merge base from,
33
+ one is specified by the first commit argument on the command line;
34
+ the other commit is a (possibly hypothetical) commit that is a merge
35
+ across all the remaining commits on the command line.
31
36
32
37
As a consequence, the 'merge base' is not necessarily contained in each of the
33
38
commit arguments if more than two commits are specified. This is different
34
39
from linkgit:git-show-branch[1] when used with the `--merge-base` option.
35
40
36
- OPTIONS
37
- -------
38
- -a::
39
- --all::
40
- Output all merge bases for the commits, instead of just one.
41
-
42
41
--octopus::
43
42
Compute the best common ancestors of all supplied commits,
44
43
in preparation for an n-way merge. This mimics the behavior
@@ -51,6 +50,12 @@ OPTIONS
51
50
from any other. This mimics the behavior of 'git show-branch
52
51
--independent'.
53
52
53
+ OPTIONS
54
+ -------
55
+ -a::
56
+ --all::
57
+ Output all merge bases for the commits, instead of just one.
58
+
54
59
DISCUSSION
55
60
----------
56
61
@@ -89,6 +94,9 @@ and the result of `git merge-base A M` is '1'. Commit '2' is also a
89
94
common ancestor between 'A' and 'M', but '1' is a better common ancestor,
90
95
because '2' is an ancestor of '1'. Hence, '2' is not a merge base.
91
96
97
+ The result of `git merge-base --octopus A B C` is '2', because '2' is
98
+ the best common ancestor of all commits.
99
+
92
100
When the history involves criss-cross merges, there can be more than one
93
101
'best' common ancestor for two commits. For example, with this topology:
94
102
0 commit comments