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