1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.4.5" />
7 <title>git-merge(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
245 list-style-type: upper-roman
;
248 div
.compact ul
, div
.compact ol
,
249 div
.compact p
, div
.compact p
,
250 div
.compact div
, div
.compact div
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
275 div
.tableblock
> table
[frame
="hsides"] {
276 border-left-style: none
;
277 border-right-style: none
;
279 div
.tableblock
> table
[frame
="vsides"] {
280 border-top-style: none
;
281 border-bottom-style: none
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-merge(
1) Manual Page
409 <div class=
"sectionbody">
411 Join two or more development histories together
415 <h2 id=
"_synopsis">SYNOPSIS
</h2>
416 <div class=
"sectionbody">
417 <div class=
"verseblock">
418 <div class=
"verseblock-content"><em>git merge
</em> [-n] [--stat] [--no-commit] [--squash]
419 [-s
<strategy
>] [-X
<strategy-option
>]
420 [--[no-]rerere-autoupdate] [-m
<msg
>] [
<commit
>…]
421 <em>git merge
</em> <msg
> HEAD
<commit
>…
422 <em>git merge
</em> --abort
</div>
423 <div class=
"verseblock-attribution">
426 <h2 id=
"_description">DESCRIPTION
</h2>
427 <div class=
"sectionbody">
428 <div class=
"paragraph"><p>Incorporates changes from the named commits (since the time their
429 histories diverged from the current branch) into the current
430 branch. This command is used by
<em>git pull
</em> to incorporate changes
431 from another repository and can be used by hand to merge changes
432 from one branch into another.
</p></div>
433 <div class=
"paragraph"><p>Assume the following history exists and the current branch is
434 "<tt>master</tt>":
</p></div>
435 <div class=
"listingblock">
436 <div class=
"content">
437 <pre><tt> A---B---C topic
439 D---E---F---G master
</tt></pre>
441 <div class=
"paragraph"><p>Then
"<tt>git merge topic</tt>" will replay the changes made on the
442 <tt>topic
</tt> branch since it diverged from
<tt>master
</tt> (i.e.,
<tt>E
</tt>) until
443 its current commit (
<tt>C
</tt>) on top of
<tt>master
</tt>, and record the result
444 in a new commit along with the names of the two parent commits and
445 a log message from the user describing the changes.
</p></div>
446 <div class=
"listingblock">
447 <div class=
"content">
448 <pre><tt> A---B---C topic
450 D---E---F---G---H master
</tt></pre>
452 <div class=
"paragraph"><p>The second syntax (
<msg
> <tt>HEAD
</tt> <commit
>…) is supported for
453 historical reasons. Do not use it from the command line or in
454 new scripts. It is the same as
<tt>git merge -m
<msg
> <commit
>…</tt>.
</p></div>
455 <div class=
"paragraph"><p>The third syntax (
"<tt>git merge --abort</tt>") can only be run after the
456 merge has resulted in conflicts.
<em>git merge --abort
</em> will abort the
457 merge process and try to reconstruct the pre-merge state. However,
458 if there were uncommitted changes when the merge started (and
459 especially if those changes were further modified after the merge
460 was started),
<em>git merge --abort
</em> will in some cases be unable to
461 reconstruct the original (pre-merge) changes. Therefore:
</p></div>
462 <div class=
"paragraph"><p><strong>Warning
</strong>: Running
<em>git merge
</em> with uncommitted changes is
463 discouraged: while possible, it leaves you in a state that is hard to
464 back out of in the case of a conflict.
</p></div>
466 <h2 id=
"_options">OPTIONS
</h2>
467 <div class=
"sectionbody">
468 <div class=
"dlist"><dl>
477 Perform the merge and commit the result. This option can
478 be used to override --no-commit.
480 <div class=
"paragraph"><p>With --no-commit perform the merge but pretend the merge
481 failed and do not autocommit, to give the user a chance to
482 inspect and further tweak the merge result before committing.
</p></div>
492 Do not generate a merge commit if the merge resolved as
493 a fast-forward, only update the branch pointer. This is
494 the default behavior of git-merge.
496 <div class=
"paragraph"><p>With --no-ff Generate a merge commit even if the merge
497 resolved as a fast-forward.
</p></div>
507 In addition to branch names, populate the log message with
508 one-line descriptions from at most
<n
> actual commits that are being
509 merged. See also
<a href=
"git-fmt-merge-msg.html">git-fmt-merge-msg(
1)
</a>.
511 <div class=
"paragraph"><p>With --no-log do not list one-line descriptions from the
512 actual commits being merged.
</p></div>
525 Show a diffstat at the end of the merge. The diffstat is also
526 controlled by the configuration option merge.stat.
528 <div class=
"paragraph"><p>With -n or --no-stat do not show a diffstat at the end of the
539 Produce the working tree and index state as if a real
540 merge happened (except for the merge information),
541 but do not actually make a commit or
542 move the
<tt>HEAD
</tt>, nor record
<tt>$GIT_DIR/MERGE_HEAD
</tt> to
543 cause the next
<tt>git commit
</tt> command to create a merge
544 commit. This allows you to create a single commit on
545 top of the current branch whose effect is the same as
546 merging another branch (or more in case of an octopus).
548 <div class=
"paragraph"><p>With --no-squash perform the merge and commit the result. This
549 option can be used to override --squash.
</p></div>
556 Refuse to merge and exit with a non-zero status unless the
557 current
<tt>HEAD
</tt> is already up-to-date or the merge can be
558 resolved as a fast-forward.
565 --strategy=
<strategy
>
569 Use the given merge strategy; can be supplied more than
570 once to specify them in the order they should be tried.
571 If there is no
<tt>-s
</tt> option, a built-in list of strategies
572 is used instead (
<em>git merge-recursive
</em> when merging a single
573 head,
<em>git merge-octopus
</em> otherwise).
580 --strategy-option=
<option
>
584 Pass merge strategy specific option through to the merge
596 Synonyms to --stat and --no-stat; these are deprecated and will be
597 removed in the future.
608 Operate quietly. Implies --no-progress.
630 Turn progress on/off explicitly. If neither is specified,
631 progress is shown if standard error is connected to a terminal.
632 Note that not all merge strategies may support progress
641 Set the commit message to be used for the merge commit (in
642 case one is created).
644 <div class=
"paragraph"><p>If
<tt>--log
</tt> is specified, a shortlog of the commits being merged
645 will be appended to the specified message.
</p></div>
646 <div class=
"paragraph"><p>The
<em>git fmt-merge-msg
</em> command can be
647 used to give a good default for automated
<em>git merge
</em>
648 invocations.
</p></div>
654 --no-rerere-autoupdate
658 Allow the rerere mechanism to update the index with the
659 result of auto-conflict resolution if possible.
667 Abort the current conflict resolution process, and
668 try to reconstruct the pre-merge state.
670 <div class=
"paragraph"><p>If there were uncommitted worktree changes present when the merge
671 started,
<em>git merge --abort
</em> will in some cases be unable to
672 reconstruct these changes. It is therefore recommended to always
673 commit or stash your changes before running
<em>git merge
</em>.
</p></div>
674 <div class=
"paragraph"><p><em>git merge --abort
</em> is equivalent to
<em>git reset --merge
</em> when
675 <tt>MERGE_HEAD
</tt> is present.
</p></div>
678 <commit
>…
682 Commits, usually other branch heads, to merge into our branch.
683 Specifying more than one commit will create a merge with
684 more than two parents (affectionately called an Octopus merge).
686 <div class=
"paragraph"><p>If no commit is given from the command line, and if
<tt>merge.defaultToUpstream
</tt>
687 configuration variable is set, merge the remote tracking branches
688 that the current branch is configured to use as its upstream.
689 See also the configuration section of this manual page.
</p></div>
693 <h2 id=
"_pre_merge_checks">PRE-MERGE CHECKS
</h2>
694 <div class=
"sectionbody">
695 <div class=
"paragraph"><p>Before applying outside changes, you should get your own work in
696 good shape and committed locally, so it will not be clobbered if
697 there are conflicts. See also
<a href=
"git-stash.html">git-stash(
1)
</a>.
698 <em>git pull
</em> and
<em>git merge
</em> will stop without doing anything when
699 local uncommitted changes overlap with files that
<em>git pull
</em>/
<em>git
700 merge
</em> may need to update.
</p></div>
701 <div class=
"paragraph"><p>To avoid recording unrelated changes in the merge commit,
702 <em>git pull
</em> and
<em>git merge
</em> will also abort if there are any changes
703 registered in the index relative to the
<tt>HEAD
</tt> commit. (One
704 exception is when the changed index entries are in the state that
705 would result from the merge already.)
</p></div>
706 <div class=
"paragraph"><p>If all named commits are already ancestors of
<tt>HEAD
</tt>,
<em>git merge
</em>
707 will exit early with the message
"Already up-to-date."</p></div>
709 <h2 id=
"_fast_forward_merge">FAST-FORWARD MERGE
</h2>
710 <div class=
"sectionbody">
711 <div class=
"paragraph"><p>Often the current branch head is an ancestor of the named commit.
712 This is the most common case especially when invoked from
<em>git
713 pull
</em>: you are tracking an upstream repository, you have committed
714 no local changes, and now you want to update to a newer upstream
715 revision. In this case, a new commit is not needed to store the
716 combined history; instead, the
<tt>HEAD
</tt> (along with the index) is
717 updated to point at the named commit, without creating an extra
718 merge commit.
</p></div>
719 <div class=
"paragraph"><p>This behavior can be suppressed with the
<tt>--no-ff
</tt> option.
</p></div>
721 <h2 id=
"_true_merge">TRUE MERGE
</h2>
722 <div class=
"sectionbody">
723 <div class=
"paragraph"><p>Except in a fast-forward merge (see above), the branches to be
724 merged must be tied together by a merge commit that has both of them
725 as its parents.
</p></div>
726 <div class=
"paragraph"><p>A merged version reconciling the changes from all branches to be
727 merged is committed, and your
<tt>HEAD
</tt>, index, and working tree are
728 updated to it. It is possible to have modifications in the working
729 tree as long as they do not overlap; the update will preserve them.
</p></div>
730 <div class=
"paragraph"><p>When it is not obvious how to reconcile the changes, the following
732 <div class=
"olist arabic"><ol class=
"arabic">
735 The
<tt>HEAD
</tt> pointer stays the same.
740 The
<tt>MERGE_HEAD
</tt> ref is set to point to the other branch head.
745 Paths that merged cleanly are updated both in the index file and
746 in your working tree.
751 For conflicting paths, the index file records up to three
752 versions: stage
1 stores the version from the common ancestor,
753 stage
2 from
<tt>HEAD
</tt>, and stage
3 from
<tt>MERGE_HEAD
</tt> (you
754 can inspect the stages with
<tt>git ls-files -u
</tt>). The working
755 tree files contain the result of the
"merge" program; i.e.
3-way
756 merge results with familiar conflict markers
<tt><<<</tt> <tt>===
</tt> <tt>>>></tt>.
761 No other changes are made. In particular, the local
762 modifications you had before you started merge will stay the
763 same and the index entries for them stay as they were,
764 i.e. matching
<tt>HEAD
</tt>.
768 <div class=
"paragraph"><p>If you tried a merge which resulted in complex conflicts and
769 want to start over, you can recover with
<tt>git merge --abort
</tt>.
</p></div>
771 <h2 id=
"_how_conflicts_are_presented">HOW CONFLICTS ARE PRESENTED
</h2>
772 <div class=
"sectionbody">
773 <div class=
"paragraph"><p>During a merge, the working tree files are updated to reflect the result
774 of the merge. Among the changes made to the common ancestor
’s version,
775 non-overlapping ones (that is, you changed an area of the file while the
776 other side left that area intact, or vice versa) are incorporated in the
777 final result verbatim. When both sides made changes to the same area,
778 however, git cannot randomly pick one side over the other, and asks you to
779 resolve it by leaving what both sides did to that area.
</p></div>
780 <div class=
"paragraph"><p>By default, git uses the same style as that is used by
"merge" program
781 from the RCS suite to present such a conflicted hunk, like this:
</p></div>
782 <div class=
"listingblock">
783 <div class=
"content">
784 <pre><tt>Here are lines that are either unchanged from the common
785 ancestor, or cleanly resolved because only one side changed.
786 <<<<<<< yours:sample.txt
787 Conflict resolution is hard;
790 Git makes conflict resolution easy.
791 >>>>>>> theirs:sample.txt
792 And here is another line that is cleanly resolved or unmodified.
</tt></pre>
794 <div class=
"paragraph"><p>The area where a pair of conflicting changes happened is marked with markers
795 <tt><<<<<<<</tt>,
<tt>=======
</tt>, and
<tt>>>>>>>></tt>. The part before the
<tt>=======
</tt>
796 is typically your side, and the part afterwards is typically their side.
</p></div>
797 <div class=
"paragraph"><p>The default format does not show what the original said in the conflicting
798 area. You cannot tell how many lines are deleted and replaced with
799 Barbie
’s remark on your side. The only thing you can tell is that your
800 side wants to say it is hard and you
’d prefer to go shopping, while the
801 other side wants to claim it is easy.
</p></div>
802 <div class=
"paragraph"><p>An alternative style can be used by setting the
"merge.conflictstyle"
803 configuration variable to
"diff3". In
"diff3" style, the above conflict
804 may look like this:
</p></div>
805 <div class=
"listingblock">
806 <div class=
"content">
807 <pre><tt>Here are lines that are either unchanged from the common
808 ancestor, or cleanly resolved because only one side changed.
809 <<<<<<< yours:sample.txt
810 Conflict resolution is hard;
813 Conflict resolution is hard.
815 Git makes conflict resolution easy.
816 >>>>>>> theirs:sample.txt
817 And here is another line that is cleanly resolved or unmodified.
</tt></pre>
819 <div class=
"paragraph"><p>In addition to the
<tt><<<<<<<</tt>,
<tt>=======
</tt>, and
<tt>>>>>>>></tt> markers, it uses
820 another
<tt>|||||||
</tt> marker that is followed by the original text. You can
821 tell that the original just stated a fact, and your side simply gave in to
822 that statement and gave up, while the other side tried to have a more
823 positive attitude. You can sometimes come up with a better resolution by
824 viewing the original.
</p></div>
826 <h2 id=
"_how_to_resolve_conflicts">HOW TO RESOLVE CONFLICTS
</h2>
827 <div class=
"sectionbody">
828 <div class=
"paragraph"><p>After seeing a conflict, you can do two things:
</p></div>
829 <div class=
"ulist"><ul>
832 Decide not to merge. The only clean-ups you need are to reset
833 the index file to the
<tt>HEAD
</tt> commit to reverse
2. and to clean
834 up working tree changes made by
2. and
3.;
<tt>git merge --abort
</tt>
835 can be used for this.
840 Resolve the conflicts. Git will mark the conflicts in
841 the working tree. Edit the files into shape and
842 <em>git add
</em> them to the index. Use
<em>git commit
</em> to seal the deal.
846 <div class=
"paragraph"><p>You can work through the conflict with a number of tools:
</p></div>
847 <div class=
"ulist"><ul>
850 Use a mergetool.
<tt>git mergetool
</tt> to launch a graphical
851 mergetool which will work you through the merge.
856 Look at the diffs.
<tt>git diff
</tt> will show a three-way diff,
857 highlighting changes from both the
<tt>HEAD
</tt> and
<tt>MERGE_HEAD
</tt>
863 Look at the diffs from each branch.
<tt>git log --merge -p
<path
></tt>
864 will show diffs first for the
<tt>HEAD
</tt> version and then the
865 <tt>MERGE_HEAD
</tt> version.
870 Look at the originals.
<tt>git show :
1:filename
</tt> shows the
871 common ancestor,
<tt>git show :
2:filename
</tt> shows the
<tt>HEAD
</tt>
872 version, and
<tt>git show :
3:filename
</tt> shows the
<tt>MERGE_HEAD
</tt>
878 <h2 id=
"_examples">EXAMPLES
</h2>
879 <div class=
"sectionbody">
880 <div class=
"ulist"><ul>
883 Merge branches
<tt>fixes
</tt> and
<tt>enhancements
</tt> on top of
884 the current branch, making an octopus merge:
886 <div class=
"listingblock">
887 <div class=
"content">
888 <pre><tt>$ git merge fixes enhancements
</tt></pre>
893 Merge branch
<tt>obsolete
</tt> into the current branch, using
<tt>ours
</tt>
896 <div class=
"listingblock">
897 <div class=
"content">
898 <pre><tt>$ git merge -s ours obsolete
</tt></pre>
903 Merge branch
<tt>maint
</tt> into the current branch, but do not make
904 a new commit automatically:
906 <div class=
"listingblock">
907 <div class=
"content">
908 <pre><tt>$ git merge --no-commit maint
</tt></pre>
910 <div class=
"paragraph"><p>This can be used when you want to include further changes to the
911 merge, or want to write your own merge commit message.
</p></div>
912 <div class=
"paragraph"><p>You should refrain from abusing this option to sneak substantial
913 changes into a merge commit. Small fixups like bumping
914 release/version name would be acceptable.
</p></div>
918 <h2 id=
"_merge_strategies">MERGE STRATEGIES
</h2>
919 <div class=
"sectionbody">
920 <div class=
"paragraph"><p>The merge mechanism (
<em>git-merge
</em> and
<em>git-pull
</em> commands) allows the
921 backend
<em>merge strategies
</em> to be chosen with
<tt>-s
</tt> option. Some strategies
922 can also take their own options, which can be passed by giving
<tt>-X
<option
></tt>
923 arguments to
<em>git-merge
</em> and/or
<em>git-pull
</em>.
</p></div>
924 <div class=
"dlist"><dl>
930 This can only resolve two heads (i.e. the current branch
931 and another branch you pulled from) using a
3-way merge
932 algorithm. It tries to carefully detect criss-cross
933 merge ambiguities and is considered generally safe and
942 This can only resolve two heads using a
3-way merge
943 algorithm. When there is more than one common
944 ancestor that can be used for
3-way merge, it creates a
945 merged tree of the common ancestors and uses that as
946 the reference tree for the
3-way merge. This has been
947 reported to result in fewer merge conflicts without
948 causing mis-merges by tests done on actual merge commits
949 taken from Linux
2.6 kernel development history.
950 Additionally this can detect and handle merges involving
951 renames. This is the default merge strategy when
952 pulling or merging one branch.
954 <div class=
"paragraph"><p>The
<em>recursive
</em> strategy can take the following options:
</p></div>
955 <div class=
"dlist"><dl>
961 This option forces conflicting hunks to be auto-resolved cleanly by
962 favoring
<em>our
</em> version. Changes from the other tree that do not
963 conflict with our side are reflected to the merge result.
965 <div class=
"paragraph"><p>This should not be confused with the
<em>ours
</em> merge strategy, which does not
966 even look at what the other tree contains at all. It discards everything
967 the other tree did, declaring
<em>our
</em> history contains all that happened in it.
</p></div>
974 This is opposite of
<em>ours
</em>.
982 With this option,
<em>merge-recursive
</em> spends a little extra time
983 to avoid mismerges that sometimes occur due to unimportant
984 matching lines (e.g., braces from distinct functions). Use
985 this when the branches to be merged have diverged wildly.
986 See also
<a href=
"git-diff.html">git-diff(
1)
</a> <tt>--patience
</tt>.
1000 Treats lines with the indicated type of whitespace change as
1001 unchanged for the sake of a three-way merge. Whitespace
1002 changes mixed with other changes to a line are not ignored.
1003 See also
<a href=
"git-diff.html">git-diff(
1)
</a> <tt>-b
</tt>,
<tt>-w
</tt>, and
1004 <tt>--ignore-space-at-eol
</tt>.
1006 <div class=
"ulist"><ul>
1009 If
<em>their
</em> version only introduces whitespace changes to a line,
1010 <em>our
</em> version is used;
1015 If
<em>our
</em> version introduces whitespace changes but
<em>their
</em>
1016 version includes a substantial change,
<em>their
</em> version is used;
1021 Otherwise, the merge proceeds in the usual way.
1026 <dt class=
"hdlist1">
1031 This runs a virtual check-out and check-in of all three stages
1032 of a file when resolving a three-way merge. This option is
1033 meant to be used when merging branches with different clean
1034 filters or end-of-line normalization rules. See
"Merging
1035 branches with differing checkin/checkout attributes" in
1036 <a href=
"gitattributes.html">gitattributes(
5)
</a> for details.
1039 <dt class=
"hdlist1">
1044 Disables the
<tt>renormalize
</tt> option. This overrides the
1045 <tt>merge.renormalize
</tt> configuration variable.
1048 <dt class=
"hdlist1">
1049 rename-threshold=
<n
>
1053 Controls the similarity threshold used for rename detection.
1054 See also
<a href=
"git-diff.html">git-diff(
1)
</a> <tt>-M
</tt>.
1057 <dt class=
"hdlist1">
1058 subtree[=
<path
>]
1062 This option is a more advanced form of
<em>subtree
</em> strategy, where
1063 the strategy makes a guess on how two trees must be shifted to
1064 match with each other when merging. Instead, the specified path
1065 is prefixed (or stripped from the beginning) to make the shape of
1071 <dt class=
"hdlist1">
1076 This resolves cases with more than two heads, but refuses to do
1077 a complex merge that needs manual resolution. It is
1078 primarily meant to be used for bundling topic branch
1079 heads together. This is the default merge strategy when
1080 pulling or merging more than one branch.
1083 <dt class=
"hdlist1">
1088 This resolves any number of heads, but the resulting tree of the
1089 merge is always that of the current branch head, effectively
1090 ignoring all changes from all other branches. It is meant to
1091 be used to supersede old development history of side
1092 branches. Note that this is different from the -Xours option to
1093 the
<em>recursive
</em> merge strategy.
1096 <dt class=
"hdlist1">
1101 This is a modified recursive strategy. When merging trees A and
1102 B, if B corresponds to a subtree of A, B is first adjusted to
1103 match the tree structure of A, instead of reading the trees at
1104 the same level. This adjustment is also done to the common
1110 <h2 id=
"_configuration">CONFIGURATION
</h2>
1111 <div class=
"sectionbody">
1112 <div class=
"dlist"><dl>
1113 <dt class=
"hdlist1">
1118 Specify the style in which conflicted hunks are written out to
1119 working tree files upon merge. The default is
"merge", which
1120 shows a
<tt><<<<<<<</tt> conflict marker, changes made by one side,
1121 a
<tt>=======
</tt> marker, changes made by the other side, and then
1122 a
<tt>>>>>>>></tt> marker. An alternate style,
"diff3", adds a
<tt>|||||||
</tt>
1123 marker and the original text before the
<tt>=======
</tt> marker.
1126 <dt class=
"hdlist1">
1127 merge.defaultToUpstream
1131 If merge is called without any commit argument, merge the upstream
1132 branches configured for the current branch by using their last
1133 observed values stored in their remote tracking branches.
1134 The values of the
<tt>branch.
<current branch
>.merge
</tt> that name the
1135 branches at the remote named by
<tt>branch.
<current branch
>.remote
</tt>
1136 are consulted, and then they are mapped via
<tt>remote.
<remote
>.fetch
</tt>
1137 to their corresponding remote tracking branches, and the tips of
1138 these tracking branches are merged.
1141 <dt class=
"hdlist1">
1146 By default, git does not create an extra merge commit when merging
1147 a commit that is a descendant of the current commit. Instead, the
1148 tip of the current branch is fast-forwarded. When set to
<tt>false
</tt>,
1149 this variable tells git to create an extra merge commit in such
1150 a case (equivalent to giving the
<tt>--no-ff
</tt> option from the command
1151 line). When set to
<tt>only
</tt>, only such fast-forward merges are
1152 allowed (equivalent to giving the
<tt>--ff-only
</tt> option from the
1156 <dt class=
"hdlist1">
1161 In addition to branch names, populate the log message with at
1162 most the specified number of one-line descriptions from the
1163 actual commits that are being merged. Defaults to false, and
1164 true is a synonym for
20.
1167 <dt class=
"hdlist1">
1172 The number of files to consider when performing rename detection
1173 during a merge; if not specified, defaults to the value of
1177 <dt class=
"hdlist1">
1182 Tell git that canonical representation of files in the
1183 repository has changed over time (e.g. earlier commits record
1184 text files with CRLF line endings, but recent ones use LF line
1185 endings). In such a repository, git can convert the data
1186 recorded in commits to a canonical form before performing a
1187 merge to reduce unnecessary conflicts. For more information,
1188 see section
"Merging branches with differing checkin/checkout
1189 attributes" in
<a href=
"gitattributes.html">gitattributes(
5)
</a>.
1192 <dt class=
"hdlist1">
1197 Whether to print the diffstat between ORIG_HEAD and the merge result
1198 at the end of the merge. True by default.
1201 <dt class=
"hdlist1">
1206 Controls which merge resolution program is used by
1207 <a href=
"git-mergetool.html">git-mergetool(
1)
</a>. Valid built-in values are:
"araxis",
1208 "bc3",
"diffuse",
"ecmerge",
"emerge",
"gvimdiff",
"kdiff3",
"meld",
1209 "opendiff",
"p4merge",
"tkdiff",
"tortoisemerge",
"vimdiff"
1210 and
"xxdiff". Any other value is treated is custom merge tool
1211 and there must be a corresponding mergetool.
<tool
>.cmd option.
1214 <dt class=
"hdlist1">
1219 Controls the amount of output shown by the recursive merge
1220 strategy. Level
0 outputs nothing except a final error
1221 message if conflicts were detected. Level
1 outputs only
1222 conflicts,
2 outputs conflicts and file changes. Level
5 and
1223 above outputs debugging information. The default is level
2.
1224 Can be overridden by the
<em>GIT_MERGE_VERBOSITY
</em> environment variable.
1227 <dt class=
"hdlist1">
1228 merge.
<driver
>.name
1232 Defines a human-readable name for a custom low-level
1233 merge driver. See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for details.
1236 <dt class=
"hdlist1">
1237 merge.
<driver
>.driver
1241 Defines the command that implements a custom low-level
1242 merge driver. See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for details.
1245 <dt class=
"hdlist1">
1246 merge.
<driver
>.recursive
1250 Names a low-level merge driver to be used when
1251 performing an internal merge between common ancestors.
1252 See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for details.
1255 <dt class=
"hdlist1">
1256 branch.
<name
>.mergeoptions
1260 Sets default options for merging into branch
<name
>. The syntax and
1261 supported options are the same as those of
<em>git merge
</em>, but option
1262 values containing whitespace characters are currently not supported.
1267 <h2 id=
"_see_also">SEE ALSO
</h2>
1268 <div class=
"sectionbody">
1269 <div class=
"paragraph"><p><a href=
"git-fmt-merge-msg.html">git-fmt-merge-msg(
1)
</a>,
<a href=
"git-pull.html">git-pull(
1)
</a>,
1270 <a href=
"gitattributes.html">gitattributes(
5)
</a>,
1271 <a href=
"git-reset.html">git-reset(
1)
</a>,
1272 <a href=
"git-diff.html">git-diff(
1)
</a>,
<a href=
"git-ls-files.html">git-ls-files(
1)
</a>,
1273 <a href=
"git-add.html">git-add(
1)
</a>,
<a href=
"git-rm.html">git-rm(
1)
</a>,
1274 <a href=
"git-mergetool.html">git-mergetool(
1)
</a></p></div>
1276 <h2 id=
"_git">GIT
</h2>
1277 <div class=
"sectionbody">
1278 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1281 <div id=
"footer-text">
1282 Last updated
2011-
04-
02 04:
31:
58 UTC