@@ -6,21 +6,23 @@ backend 'merge strategies' to be chosen with `-s` option. Some strategies
6
6
can also take their own options, which can be passed by giving `-X<option>`
7
7
arguments to `git merge` and/or `git pull`.
8
8
9
- recursive::
10
- This can only resolve two heads using a 3-way merge
11
- algorithm. When there is more than one common
12
- ancestor that can be used for 3-way merge, it creates a
13
- merged tree of the common ancestors and uses that as
14
- the reference tree for the 3-way merge. This has been
15
- reported to result in fewer merge conflicts without
16
- causing mismerges by tests done on actual merge commits
17
- taken from Linux 2.6 kernel development history.
18
- Additionally this can detect and handle merges involving
19
- renames. It does not make use of detected copies. This
20
- is the default merge strategy when pulling or merging one
21
- branch.
9
+ ort::
10
+ This is the default merge strategy when pulling or merging one
11
+ branch. This strategy can only resolve two heads using a
12
+ 3-way merge algorithm. When there is more than one common
13
+ ancestor that can be used for 3-way merge, it creates a merged
14
+ tree of the common ancestors and uses that as the reference
15
+ tree for the 3-way merge. This has been reported to result in
16
+ fewer merge conflicts without causing mismerges by tests done
17
+ on actual merge commits taken from Linux 2.6 kernel
18
+ development history. Additionally this strategy can detect
19
+ and handle merges involving renames. It does not make use of
20
+ detected copies. The name for this algorithm is an acronym
21
+ ("Ostensibly Recursive's Twin") and came from the fact that it
22
+ was written as a replacement for the previous default
23
+ algorithm, `recursive`.
22
24
+
23
- The 'recursive ' strategy can take the following options:
25
+ The 'ort ' strategy can take the following options:
24
26
25
27
ours;;
26
28
This option forces conflicting hunks to be auto-resolved cleanly by
@@ -36,16 +38,6 @@ theirs;;
36
38
This is the opposite of 'ours'; note that, unlike 'ours', there is
37
39
no 'theirs' merge strategy to confuse this merge option with.
38
40
39
- patience;;
40
- Deprecated synonym for `diff-algorithm=patience`.
41
-
42
- diff-algorithm=[patience|minimal|histogram|myers];;
43
- Use a different diff algorithm while merging, which can help
44
- avoid mismerges that occur due to unimportant matching lines
45
- (such as braces from distinct functions). See also
46
- linkgit:git-diff[1] `--diff-algorithm`. Defaults to the
47
- `diff.algorithm` config setting.
48
-
49
41
ignore-space-change;;
50
42
ignore-all-space;;
51
43
ignore-space-at-eol;;
@@ -74,11 +66,6 @@ no-renormalize;;
74
66
Disables the `renormalize` option. This overrides the
75
67
`merge.renormalize` configuration variable.
76
68
77
- no-renames;;
78
- Turn off rename detection. This overrides the `merge.renames`
79
- configuration variable.
80
- See also linkgit:git-diff[1] `--no-renames`.
81
-
82
69
find-renames[=<n>];;
83
70
Turn on rename detection, optionally setting the similarity
84
71
threshold. This is the default. This overrides the
@@ -95,19 +82,39 @@ subtree[=<path>];;
95
82
is prefixed (or stripped from the beginning) to make the shape of
96
83
two trees to match.
97
84
98
- ort::
99
- This is meant as a drop-in replacement for the `recursive`
100
- algorithm (as reflected in its acronym -- "Ostensibly
101
- Recursive's Twin"), and will likely replace it in the future.
102
- It fixes corner cases that the `recursive` strategy handles
103
- suboptimally, and is significantly faster in large
104
- repositories -- especially when many renames are involved.
85
+ recursive::
86
+ This can only resolve two heads using a 3-way merge
87
+ algorithm. When there is more than one common
88
+ ancestor that can be used for 3-way merge, it creates a
89
+ merged tree of the common ancestors and uses that as
90
+ the reference tree for the 3-way merge. This has been
91
+ reported to result in fewer merge conflicts without
92
+ causing mismerges by tests done on actual merge commits
93
+ taken from Linux 2.6 kernel development history.
94
+ Additionally this can detect and handle merges involving
95
+ renames. It does not make use of detected copies. This was
96
+ the default strategy for resolving two heads from Git v0.99.9k
97
+ until v2.33.0.
105
98
+
106
- The `ort` strategy takes all the same options as `recursive`.
107
- However, it ignores three of those options: `no-renames`,
108
- `patience` and `diff-algorithm`. It always runs with rename
109
- detection (it handles it much faster than `recursive` does), and
110
- it specifically uses `diff-algorithm=histogram`.
99
+ The 'recursive' strategy takes the same options as 'ort'. However,
100
+ there are three additional options that 'ort' ignores (not documented
101
+ above) that are potentially useful with the 'recursive' strategy:
102
+
103
+ patience;;
104
+ Deprecated synonym for `diff-algorithm=patience`.
105
+
106
+ diff-algorithm=[patience|minimal|histogram|myers];;
107
+ Use a different diff algorithm while merging, which can help
108
+ avoid mismerges that occur due to unimportant matching lines
109
+ (such as braces from distinct functions). See also
110
+ linkgit:git-diff[1] `--diff-algorithm`. Note that `ort`
111
+ specifically uses `diff-algorithm=histogram`, while `recursive`
112
+ defaults to the `diff.algorithm` config setting.
113
+
114
+ no-renames;;
115
+ Turn off rename detection. This overrides the `merge.renames`
116
+ configuration variable.
117
+ See also linkgit:git-diff[1] `--no-renames`.
111
118
112
119
resolve::
113
120
This can only resolve two heads (i.e. the current branch
@@ -131,13 +138,13 @@ ours::
131
138
the 'recursive' merge strategy.
132
139
133
140
subtree::
134
- This is a modified recursive strategy. When merging trees A and
141
+ This is a modified ort strategy. When merging trees A and
135
142
B, if B corresponds to a subtree of A, B is first adjusted to
136
143
match the tree structure of A, instead of reading the trees at
137
144
the same level. This adjustment is also done to the common
138
145
ancestor tree.
139
146
140
- With the strategies that use 3-way merge (including the default, 'recursive '),
147
+ With the strategies that use 3-way merge (including the default, 'ort '),
141
148
if a change is made on both branches, but later reverted on one of the
142
149
branches, that change will be present in the merged result; some people find
143
150
this behavior confusing. It occurs because only the heads and the merge base
0 commit comments