1GIT-MERGE(1) Git Manual GIT-MERGE(1)
2
3
4
6 git-merge - Join two or more development histories together
7
9 git merge [-n] [--stat] [--no-commit] [--squash] [--[no-]edit]
10 [--no-verify] [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]]
11 [--[no-]allow-unrelated-histories]
12 [--[no-]rerere-autoupdate] [-m <msg>] [-F <file>] [<commit>...]
13 git merge (--continue | --abort | --quit)
14
16 Incorporates changes from the named commits (since the time their
17 histories diverged from the current branch) into the current branch.
18 This command is used by git pull to incorporate changes from another
19 repository and can be used by hand to merge changes from one branch
20 into another.
21
22 Assume the following history exists and the current branch is "master":
23
24 A---B---C topic
25 /
26 D---E---F---G master
27
28 Then "git merge topic" will replay the changes made on the topic branch
29 since it diverged from master (i.e., E) until its current commit (C) on
30 top of master, and record the result in a new commit along with the
31 names of the two parent commits and a log message from the user
32 describing the changes.
33
34 A---B---C topic
35 / \
36 D---E---F---G---H master
37
38 The second syntax ("git merge --abort") can only be run after the merge
39 has resulted in conflicts. git merge --abort will abort the merge
40 process and try to reconstruct the pre-merge state. However, if there
41 were uncommitted changes when the merge started (and especially if
42 those changes were further modified after the merge was started), git
43 merge --abort will in some cases be unable to reconstruct the original
44 (pre-merge) changes. Therefore:
45
46 Warning: Running git merge with non-trivial uncommitted changes is
47 discouraged: while possible, it may leave you in a state that is hard
48 to back out of in the case of a conflict.
49
50 The third syntax ("git merge --continue") can only be run after the
51 merge has resulted in conflicts.
52
54 --commit, --no-commit
55 Perform the merge and commit the result. This option can be used to
56 override --no-commit.
57
58 With --no-commit perform the merge and stop just before creating a
59 merge commit, to give the user a chance to inspect and further
60 tweak the merge result before committing.
61
62 Note that fast-forward updates do not create a merge commit and
63 therefore there is no way to stop those merges with --no-commit.
64 Thus, if you want to ensure your branch is not changed or updated
65 by the merge command, use --no-ff with --no-commit.
66
67 --edit, -e, --no-edit
68 Invoke an editor before committing successful mechanical merge to
69 further edit the auto-generated merge message, so that the user can
70 explain and justify the merge. The --no-edit option can be used to
71 accept the auto-generated message (this is generally discouraged).
72 The --edit (or -e) option is still useful if you are giving a draft
73 message with the -m option from the command line and want to edit
74 it in the editor.
75
76 Older scripts may depend on the historical behaviour of not
77 allowing the user to edit the merge log message. They will see an
78 editor opened when they run git merge. To make it easier to adjust
79 such scripts to the updated behaviour, the environment variable
80 GIT_MERGE_AUTOEDIT can be set to no at the beginning of them.
81
82 --cleanup=<mode>
83 This option determines how the merge message will be cleaned up
84 before committing. See git-commit(1) for more details. In addition,
85 if the <mode> is given a value of scissors, scissors will be
86 appended to MERGE_MSG before being passed on to the commit
87 machinery in the case of a merge conflict.
88
89 --ff, --no-ff, --ff-only
90 Specifies how a merge is handled when the merged-in history is
91 already a descendant of the current history. --ff is the default
92 unless merging an annotated (and possibly signed) tag that is not
93 stored in its natural place in the refs/tags/ hierarchy, in which
94 case --no-ff is assumed.
95
96 With --ff, when possible resolve the merge as a fast-forward (only
97 update the branch pointer to match the merged branch; do not create
98 a merge commit). When not possible (when the merged-in history is
99 not a descendant of the current history), create a merge commit.
100
101 With --no-ff, create a merge commit in all cases, even when the
102 merge could instead be resolved as a fast-forward.
103
104 With --ff-only, resolve the merge as a fast-forward when possible.
105 When not possible, refuse to merge and exit with a non-zero status.
106
107 -S[<keyid>], --gpg-sign[=<keyid>], --no-gpg-sign
108 GPG-sign the resulting merge commit. The keyid argument is optional
109 and defaults to the committer identity; if specified, it must be
110 stuck to the option without a space. --no-gpg-sign is useful to
111 countermand both commit.gpgSign configuration variable, and earlier
112 --gpg-sign.
113
114 --log[=<n>], --no-log
115 In addition to branch names, populate the log message with one-line
116 descriptions from at most <n> actual commits that are being merged.
117 See also git-fmt-merge-msg(1).
118
119 With --no-log do not list one-line descriptions from the actual
120 commits being merged.
121
122 --signoff, --no-signoff
123 Add a Signed-off-by trailer by the committer at the end of the
124 commit log message. The meaning of a signoff depends on the project
125 to which you’re committing. For example, it may certify that the
126 committer has the rights to submit the work under the project’s
127 license or agrees to some contributor representation, such as a
128 Developer Certificate of Origin. (See
129 http://developercertificate.org for the one used by the Linux
130 kernel and Git projects.) Consult the documentation or leadership
131 of the project to which you’re contributing to understand how the
132 signoffs are used in that project.
133
134 The --no-signoff option can be used to countermand an earlier
135 --signoff option on the command line.
136
137 --stat, -n, --no-stat
138 Show a diffstat at the end of the merge. The diffstat is also
139 controlled by the configuration option merge.stat.
140
141 With -n or --no-stat do not show a diffstat at the end of the
142 merge.
143
144 --squash, --no-squash
145 Produce the working tree and index state as if a real merge
146 happened (except for the merge information), but do not actually
147 make a commit, move the HEAD, or record $GIT_DIR/MERGE_HEAD (to
148 cause the next git commit command to create a merge commit). This
149 allows you to create a single commit on top of the current branch
150 whose effect is the same as merging another branch (or more in case
151 of an octopus).
152
153 With --no-squash perform the merge and commit the result. This
154 option can be used to override --squash.
155
156 With --squash, --commit is not allowed, and will fail.
157
158 --no-verify
159 This option bypasses the pre-merge and commit-msg hooks. See also
160 githooks(5).
161
162 -s <strategy>, --strategy=<strategy>
163 Use the given merge strategy; can be supplied more than once to
164 specify them in the order they should be tried. If there is no -s
165 option, a built-in list of strategies is used instead (recursive
166 when merging a single head, octopus otherwise).
167
168 -X <option>, --strategy-option=<option>
169 Pass merge strategy specific option through to the merge strategy.
170
171 --verify-signatures, --no-verify-signatures
172 Verify that the tip commit of the side branch being merged is
173 signed with a valid key, i.e. a key that has a valid uid: in the
174 default trust model, this means the signing key has been signed by
175 a trusted key. If the tip commit of the side branch is not signed
176 with a valid key, the merge is aborted.
177
178 --summary, --no-summary
179 Synonyms to --stat and --no-stat; these are deprecated and will be
180 removed in the future.
181
182 -q, --quiet
183 Operate quietly. Implies --no-progress.
184
185 -v, --verbose
186 Be verbose.
187
188 --progress, --no-progress
189 Turn progress on/off explicitly. If neither is specified, progress
190 is shown if standard error is connected to a terminal. Note that
191 not all merge strategies may support progress reporting.
192
193 --autostash, --no-autostash
194 Automatically create a temporary stash entry before the operation
195 begins, record it in the special ref MERGE_AUTOSTASH and apply it
196 after the operation ends. This means that you can run the operation
197 on a dirty worktree. However, use with care: the final stash
198 application after a successful merge might result in non-trivial
199 conflicts.
200
201 --allow-unrelated-histories
202 By default, git merge command refuses to merge histories that do
203 not share a common ancestor. This option can be used to override
204 this safety when merging histories of two projects that started
205 their lives independently. As that is a very rare occasion, no
206 configuration variable to enable this by default exists and will
207 not be added.
208
209 -m <msg>
210 Set the commit message to be used for the merge commit (in case one
211 is created).
212
213 If --log is specified, a shortlog of the commits being merged will
214 be appended to the specified message.
215
216 The git fmt-merge-msg command can be used to give a good default
217 for automated git merge invocations. The automated message can
218 include the branch description.
219
220 -F <file>, --file=<file>
221 Read the commit message to be used for the merge commit (in case
222 one is created).
223
224 If --log is specified, a shortlog of the commits being merged will
225 be appended to the specified message.
226
227 --rerere-autoupdate, --no-rerere-autoupdate
228 Allow the rerere mechanism to update the index with the result of
229 auto-conflict resolution if possible.
230
231 --overwrite-ignore, --no-overwrite-ignore
232 Silently overwrite ignored files from the merge result. This is the
233 default behavior. Use --no-overwrite-ignore to abort.
234
235 --abort
236 Abort the current conflict resolution process, and try to
237 reconstruct the pre-merge state. If an autostash entry is present,
238 apply it to the worktree.
239
240 If there were uncommitted worktree changes present when the merge
241 started, git merge --abort will in some cases be unable to
242 reconstruct these changes. It is therefore recommended to always
243 commit or stash your changes before running git merge.
244
245 git merge --abort is equivalent to git reset --merge when
246 MERGE_HEAD is present unless MERGE_AUTOSTASH is also present in
247 which case git merge --abort applies the stash entry to the
248 worktree whereas git reset --merge will save the stashed changes in
249 the stash list.
250
251 --quit
252 Forget about the current merge in progress. Leave the index and the
253 working tree as-is. If MERGE_AUTOSTASH is present, the stash entry
254 will be saved to the stash list.
255
256 --continue
257 After a git merge stops due to conflicts you can conclude the merge
258 by running git merge --continue (see "HOW TO RESOLVE CONFLICTS"
259 section below).
260
261 <commit>...
262 Commits, usually other branch heads, to merge into our branch.
263 Specifying more than one commit will create a merge with more than
264 two parents (affectionately called an Octopus merge).
265
266 If no commit is given from the command line, merge the
267 remote-tracking branches that the current branch is configured to
268 use as its upstream. See also the configuration section of this
269 manual page.
270
271 When FETCH_HEAD (and no other commit) is specified, the branches
272 recorded in the .git/FETCH_HEAD file by the previous invocation of
273 git fetch for merging are merged to the current branch.
274
276 Before applying outside changes, you should get your own work in good
277 shape and committed locally, so it will not be clobbered if there are
278 conflicts. See also git-stash(1). git pull and git merge will stop
279 without doing anything when local uncommitted changes overlap with
280 files that git pull/git merge may need to update.
281
282 To avoid recording unrelated changes in the merge commit, git pull and
283 git merge will also abort if there are any changes registered in the
284 index relative to the HEAD commit. (Special narrow exceptions to this
285 rule may exist depending on which merge strategy is in use, but
286 generally, the index must match HEAD.)
287
288 If all named commits are already ancestors of HEAD, git merge will exit
289 early with the message "Already up to date."
290
292 Often the current branch head is an ancestor of the named commit. This
293 is the most common case especially when invoked from git pull: you are
294 tracking an upstream repository, you have committed no local changes,
295 and now you want to update to a newer upstream revision. In this case,
296 a new commit is not needed to store the combined history; instead, the
297 HEAD (along with the index) is updated to point at the named commit,
298 without creating an extra merge commit.
299
300 This behavior can be suppressed with the --no-ff option.
301
303 Except in a fast-forward merge (see above), the branches to be merged
304 must be tied together by a merge commit that has both of them as its
305 parents.
306
307 A merged version reconciling the changes from all branches to be merged
308 is committed, and your HEAD, index, and working tree are updated to it.
309 It is possible to have modifications in the working tree as long as
310 they do not overlap; the update will preserve them.
311
312 When it is not obvious how to reconcile the changes, the following
313 happens:
314
315 1. The HEAD pointer stays the same.
316
317 2. The MERGE_HEAD ref is set to point to the other branch head.
318
319 3. Paths that merged cleanly are updated both in the index file and in
320 your working tree.
321
322 4. For conflicting paths, the index file records up to three versions:
323 stage 1 stores the version from the common ancestor, stage 2 from
324 HEAD, and stage 3 from MERGE_HEAD (you can inspect the stages with
325 git ls-files -u). The working tree files contain the result of the
326 "merge" program; i.e. 3-way merge results with familiar conflict
327 markers <<< === >>>.
328
329 5. No other changes are made. In particular, the local modifications
330 you had before you started merge will stay the same and the index
331 entries for them stay as they were, i.e. matching HEAD.
332
333 If you tried a merge which resulted in complex conflicts and want to
334 start over, you can recover with git merge --abort.
335
337 When merging an annotated (and possibly signed) tag, Git always creates
338 a merge commit even if a fast-forward merge is possible, and the commit
339 message template is prepared with the tag message. Additionally, if the
340 tag is signed, the signature check is reported as a comment in the
341 message template. See also git-tag(1).
342
343 When you want to just integrate with the work leading to the commit
344 that happens to be tagged, e.g. synchronizing with an upstream release
345 point, you may not want to make an unnecessary merge commit.
346
347 In such a case, you can "unwrap" the tag yourself before feeding it to
348 git merge, or pass --ff-only when you do not have any work on your own.
349 e.g.
350
351 git fetch origin
352 git merge v1.2.3^0
353 git merge --ff-only v1.2.3
354
356 During a merge, the working tree files are updated to reflect the
357 result of the merge. Among the changes made to the common ancestor’s
358 version, non-overlapping ones (that is, you changed an area of the file
359 while the other side left that area intact, or vice versa) are
360 incorporated in the final result verbatim. When both sides made changes
361 to the same area, however, Git cannot randomly pick one side over the
362 other, and asks you to resolve it by leaving what both sides did to
363 that area.
364
365 By default, Git uses the same style as the one used by the "merge"
366 program from the RCS suite to present such a conflicted hunk, like
367 this:
368
369 Here are lines that are either unchanged from the common
370 ancestor, or cleanly resolved because only one side changed.
371 <<<<<<< yours:sample.txt
372 Conflict resolution is hard;
373 let's go shopping.
374 =======
375 Git makes conflict resolution easy.
376 >>>>>>> theirs:sample.txt
377 And here is another line that is cleanly resolved or unmodified.
378
379 The area where a pair of conflicting changes happened is marked with
380 markers <<<<<<<, =======, and >>>>>>>. The part before the ======= is
381 typically your side, and the part afterwards is typically their side.
382
383 The default format does not show what the original said in the
384 conflicting area. You cannot tell how many lines are deleted and
385 replaced with Barbie’s remark on your side. The only thing you can tell
386 is that your side wants to say it is hard and you’d prefer to go
387 shopping, while the other side wants to claim it is easy.
388
389 An alternative style can be used by setting the "merge.conflictStyle"
390 configuration variable to "diff3". In "diff3" style, the above conflict
391 may look like this:
392
393 Here are lines that are either unchanged from the common
394 ancestor, or cleanly resolved because only one side changed.
395 <<<<<<< yours:sample.txt
396 Conflict resolution is hard;
397 let's go shopping.
398 |||||||
399 Conflict resolution is hard.
400 =======
401 Git makes conflict resolution easy.
402 >>>>>>> theirs:sample.txt
403 And here is another line that is cleanly resolved or unmodified.
404
405 In addition to the <<<<<<<, =======, and >>>>>>> markers, it uses
406 another ||||||| marker that is followed by the original text. You can
407 tell that the original just stated a fact, and your side simply gave in
408 to that statement and gave up, while the other side tried to have a
409 more positive attitude. You can sometimes come up with a better
410 resolution by viewing the original.
411
413 After seeing a conflict, you can do two things:
414
415 • Decide not to merge. The only clean-ups you need are to reset the
416 index file to the HEAD commit to reverse 2. and to clean up working
417 tree changes made by 2. and 3.; git merge --abort can be used for
418 this.
419
420 • Resolve the conflicts. Git will mark the conflicts in the working
421 tree. Edit the files into shape and git add them to the index. Use
422 git commit or git merge --continue to seal the deal. The latter
423 command checks whether there is a (interrupted) merge in progress
424 before calling git commit.
425
426 You can work through the conflict with a number of tools:
427
428 • Use a mergetool. git mergetool to launch a graphical mergetool
429 which will work you through the merge.
430
431 • Look at the diffs. git diff will show a three-way diff,
432 highlighting changes from both the HEAD and MERGE_HEAD versions.
433
434 • Look at the diffs from each branch. git log --merge -p <path> will
435 show diffs first for the HEAD version and then the MERGE_HEAD
436 version.
437
438 • Look at the originals. git show :1:filename shows the common
439 ancestor, git show :2:filename shows the HEAD version, and git show
440 :3:filename shows the MERGE_HEAD version.
441
443 • Merge branches fixes and enhancements on top of the current branch,
444 making an octopus merge:
445
446 $ git merge fixes enhancements
447
448 • Merge branch obsolete into the current branch, using ours merge
449 strategy:
450
451 $ git merge -s ours obsolete
452
453 • Merge branch maint into the current branch, but do not make a new
454 commit automatically:
455
456 $ git merge --no-commit maint
457
458 This can be used when you want to include further changes to the
459 merge, or want to write your own merge commit message.
460
461 You should refrain from abusing this option to sneak substantial
462 changes into a merge commit. Small fixups like bumping
463 release/version name would be acceptable.
464
466 The merge mechanism (git merge and git pull commands) allows the
467 backend merge strategies to be chosen with -s option. Some strategies
468 can also take their own options, which can be passed by giving
469 -X<option> arguments to git merge and/or git pull.
470
471 recursive
472 This can only resolve two heads using a 3-way merge algorithm. When
473 there is more than one common ancestor that can be used for 3-way
474 merge, it creates a merged tree of the common ancestors and uses
475 that as the reference tree for the 3-way merge. This has been
476 reported to result in fewer merge conflicts without causing
477 mismerges by tests done on actual merge commits taken from Linux
478 2.6 kernel development history. Additionally this can detect and
479 handle merges involving renames. It does not make use of detected
480 copies. This is the default merge strategy when pulling or merging
481 one branch.
482
483 The recursive strategy can take the following options:
484
485 ours
486 This option forces conflicting hunks to be auto-resolved
487 cleanly by favoring our version. Changes from the other tree
488 that do not conflict with our side are reflected in the merge
489 result. For a binary file, the entire contents are taken from
490 our side.
491
492 This should not be confused with the ours merge strategy, which
493 does not even look at what the other tree contains at all. It
494 discards everything the other tree did, declaring our history
495 contains all that happened in it.
496
497 theirs
498 This is the opposite of ours; note that, unlike ours, there is
499 no theirs merge strategy to confuse this merge option with.
500
501 patience
502 Deprecated synonym for diff-algorithm=patience.
503
504 diff-algorithm=[patience|minimal|histogram|myers]
505 Use a different diff algorithm while merging, which can help
506 avoid mismerges that occur due to unimportant matching lines
507 (such as braces from distinct functions). See also git-diff(1)
508 --diff-algorithm. Defaults to the diff.algorithm config
509 setting.
510
511 ignore-space-change, ignore-all-space, ignore-space-at-eol,
512 ignore-cr-at-eol
513 Treats lines with the indicated type of whitespace change as
514 unchanged for the sake of a three-way merge. Whitespace changes
515 mixed with other changes to a line are not ignored. See also
516 git-diff(1) -b, -w, --ignore-space-at-eol, and
517 --ignore-cr-at-eol.
518
519 • If their version only introduces whitespace changes to a
520 line, our version is used;
521
522 • If our version introduces whitespace changes but their
523 version includes a substantial change, their version is
524 used;
525
526 • Otherwise, the merge proceeds in the usual way.
527
528 renormalize
529 This runs a virtual check-out and check-in of all three stages
530 of a file when resolving a three-way merge. This option is
531 meant to be used when merging branches with different clean
532 filters or end-of-line normalization rules. See "Merging
533 branches with differing checkin/checkout attributes" in
534 gitattributes(5) for details.
535
536 no-renormalize
537 Disables the renormalize option. This overrides the
538 merge.renormalize configuration variable.
539
540 no-renames
541 Turn off rename detection. This overrides the merge.renames
542 configuration variable. See also git-diff(1) --no-renames.
543
544 find-renames[=<n>]
545 Turn on rename detection, optionally setting the similarity
546 threshold. This is the default. This overrides the
547 merge.renames configuration variable. See also git-diff(1)
548 --find-renames.
549
550 rename-threshold=<n>
551 Deprecated synonym for find-renames=<n>.
552
553 subtree[=<path>]
554 This option is a more advanced form of subtree strategy, where
555 the strategy makes a guess on how two trees must be shifted to
556 match with each other when merging. Instead, the specified path
557 is prefixed (or stripped from the beginning) to make the shape
558 of two trees to match.
559
560 ort
561 This is meant as a drop-in replacement for the recursive algorithm
562 (as reflected in its acronym — "Ostensibly Recursive’s Twin"), and
563 will likely replace it in the future. It fixes corner cases that
564 the recursive strategy handles suboptimally, and is significantly
565 faster in large repositories — especially when many renames are
566 involved.
567
568 The ort strategy takes all the same options as recursive. However,
569 it ignores three of those options: no-renames, patience and
570 diff-algorithm. It always runs with rename detection (it handles it
571 much faster than recursive does), and it specifically uses
572 diff-algorithm=histogram.
573
574 resolve
575 This can only resolve two heads (i.e. the current branch and
576 another branch you pulled from) using a 3-way merge algorithm. It
577 tries to carefully detect criss-cross merge ambiguities. It does
578 not handle renames.
579
580 octopus
581 This resolves cases with more than two heads, but refuses to do a
582 complex merge that needs manual resolution. It is primarily meant
583 to be used for bundling topic branch heads together. This is the
584 default merge strategy when pulling or merging more than one
585 branch.
586
587 ours
588 This resolves any number of heads, but the resulting tree of the
589 merge is always that of the current branch head, effectively
590 ignoring all changes from all other branches. It is meant to be
591 used to supersede old development history of side branches. Note
592 that this is different from the -Xours option to the recursive
593 merge strategy.
594
595 subtree
596 This is a modified recursive strategy. When merging trees A and B,
597 if B corresponds to a subtree of A, B is first adjusted to match
598 the tree structure of A, instead of reading the trees at the same
599 level. This adjustment is also done to the common ancestor tree.
600
601 With the strategies that use 3-way merge (including the default,
602 recursive), if a change is made on both branches, but later reverted on
603 one of the branches, that change will be present in the merged result;
604 some people find this behavior confusing. It occurs because only the
605 heads and the merge base are considered when performing a merge, not
606 the individual commits. The merge algorithm therefore considers the
607 reverted change as no change at all, and substitutes the changed
608 version instead.
609
611 merge.conflictStyle
612 Specify the style in which conflicted hunks are written out to
613 working tree files upon merge. The default is "merge", which shows
614 a <<<<<<< conflict marker, changes made by one side, a =======
615 marker, changes made by the other side, and then a >>>>>>> marker.
616 An alternate style, "diff3", adds a ||||||| marker and the original
617 text before the ======= marker.
618
619 merge.defaultToUpstream
620 If merge is called without any commit argument, merge the upstream
621 branches configured for the current branch by using their last
622 observed values stored in their remote-tracking branches. The
623 values of the branch.<current branch>.merge that name the branches
624 at the remote named by branch.<current branch>.remote are
625 consulted, and then they are mapped via remote.<remote>.fetch to
626 their corresponding remote-tracking branches, and the tips of these
627 tracking branches are merged. Defaults to true.
628
629 merge.ff
630 By default, Git does not create an extra merge commit when merging
631 a commit that is a descendant of the current commit. Instead, the
632 tip of the current branch is fast-forwarded. When set to false,
633 this variable tells Git to create an extra merge commit in such a
634 case (equivalent to giving the --no-ff option from the command
635 line). When set to only, only such fast-forward merges are allowed
636 (equivalent to giving the --ff-only option from the command line).
637
638 merge.verifySignatures
639 If true, this is equivalent to the --verify-signatures command line
640 option. See git-merge(1) for details.
641
642 merge.branchdesc
643 In addition to branch names, populate the log message with the
644 branch description text associated with them. Defaults to false.
645
646 merge.log
647 In addition to branch names, populate the log message with at most
648 the specified number of one-line descriptions from the actual
649 commits that are being merged. Defaults to false, and true is a
650 synonym for 20.
651
652 merge.suppressDest
653 By adding a glob that matches the names of integration branches to
654 this multi-valued configuration variable, the default merge message
655 computed for merges into these integration branches will omit "into
656 <branch name>" from its title.
657
658 An element with an empty value can be used to clear the list of
659 globs accumulated from previous configuration entries. When there
660 is no merge.suppressDest variable defined, the default value of
661 master is used for backward compatibility.
662
663 merge.renameLimit
664 The number of files to consider in the exhaustive portion of rename
665 detection during a merge. If not specified, defaults to the value
666 of diff.renameLimit. If neither merge.renameLimit nor
667 diff.renameLimit are specified, currently defaults to 7000. This
668 setting has no effect if rename detection is turned off.
669
670 merge.renames
671 Whether Git detects renames. If set to "false", rename detection is
672 disabled. If set to "true", basic rename detection is enabled.
673 Defaults to the value of diff.renames.
674
675 merge.directoryRenames
676 Whether Git detects directory renames, affecting what happens at
677 merge time to new files added to a directory on one side of history
678 when that directory was renamed on the other side of history. If
679 merge.directoryRenames is set to "false", directory rename
680 detection is disabled, meaning that such new files will be left
681 behind in the old directory. If set to "true", directory rename
682 detection is enabled, meaning that such new files will be moved
683 into the new directory. If set to "conflict", a conflict will be
684 reported for such paths. If merge.renames is false,
685 merge.directoryRenames is ignored and treated as false. Defaults to
686 "conflict".
687
688 merge.renormalize
689 Tell Git that canonical representation of files in the repository
690 has changed over time (e.g. earlier commits record text files with
691 CRLF line endings, but recent ones use LF line endings). In such a
692 repository, Git can convert the data recorded in commits to a
693 canonical form before performing a merge to reduce unnecessary
694 conflicts. For more information, see section "Merging branches with
695 differing checkin/checkout attributes" in gitattributes(5).
696
697 merge.stat
698 Whether to print the diffstat between ORIG_HEAD and the merge
699 result at the end of the merge. True by default.
700
701 merge.autoStash
702 When set to true, automatically create a temporary stash entry
703 before the operation begins, and apply it after the operation ends.
704 This means that you can run merge on a dirty worktree. However, use
705 with care: the final stash application after a successful merge
706 might result in non-trivial conflicts. This option can be
707 overridden by the --no-autostash and --autostash options of git-
708 merge(1). Defaults to false.
709
710 merge.tool
711 Controls which merge tool is used by git-mergetool(1). The list
712 below shows the valid built-in values. Any other value is treated
713 as a custom merge tool and requires that a corresponding
714 mergetool.<tool>.cmd variable is defined.
715
716 merge.guitool
717 Controls which merge tool is used by git-mergetool(1) when the
718 -g/--gui flag is specified. The list below shows the valid built-in
719 values. Any other value is treated as a custom merge tool and
720 requires that a corresponding mergetool.<guitool>.cmd variable is
721 defined.
722
723 • araxis
724
725 • bc
726
727 • bc3
728
729 • bc4
730
731 • codecompare
732
733 • deltawalker
734
735 • diffmerge
736
737 • diffuse
738
739 • ecmerge
740
741 • emerge
742
743 • examdiff
744
745 • guiffy
746
747 • gvimdiff
748
749 • gvimdiff1
750
751 • gvimdiff2
752
753 • gvimdiff3
754
755 • kdiff3
756
757 • meld
758
759 • nvimdiff
760
761 • nvimdiff1
762
763 • nvimdiff2
764
765 • nvimdiff3
766
767 • opendiff
768
769 • p4merge
770
771 • smerge
772
773 • tkdiff
774
775 • tortoisemerge
776
777 • vimdiff
778
779 • vimdiff1
780
781 • vimdiff2
782
783 • vimdiff3
784
785 • winmerge
786
787 • xxdiff
788
789 merge.verbosity
790 Controls the amount of output shown by the recursive merge
791 strategy. Level 0 outputs nothing except a final error message if
792 conflicts were detected. Level 1 outputs only conflicts, 2 outputs
793 conflicts and file changes. Level 5 and above outputs debugging
794 information. The default is level 2. Can be overridden by the
795 GIT_MERGE_VERBOSITY environment variable.
796
797 merge.<driver>.name
798 Defines a human-readable name for a custom low-level merge driver.
799 See gitattributes(5) for details.
800
801 merge.<driver>.driver
802 Defines the command that implements a custom low-level merge
803 driver. See gitattributes(5) for details.
804
805 merge.<driver>.recursive
806 Names a low-level merge driver to be used when performing an
807 internal merge between common ancestors. See gitattributes(5) for
808 details.
809
810 branch.<name>.mergeOptions
811 Sets default options for merging into branch <name>. The syntax and
812 supported options are the same as those of git merge, but option
813 values containing whitespace characters are currently not
814 supported.
815
817 git-fmt-merge-msg(1), git-pull(1), gitattributes(5), git-reset(1), git-
818 diff(1), git-ls-files(1), git-add(1), git-rm(1), git-mergetool(1)
819
821 Part of the git(1) suite
822
823
824
825Git 2.33.1 2021-10-12 GIT-MERGE(1)