1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <sect2 lang="en" id="git-mergetool(1)">
\r
5 <title>git-mergetool(1)</title>
\r
7 <primary>git-mergetool(1)</primary>
\r
9 <simplesect id="git-mergetool(1)__name">
\r
11 <simpara>git-mergetool - Run merge conflict resolution tools to resolve merge conflicts</simpara>
\r
13 <simplesect id="git-mergetool(1)__synopsis">
\r
14 <title>SYNOPSIS</title>
\r
16 <literallayout><emphasis>git mergetool</emphasis> [--tool=<tool>] [-y | --[no-]prompt] [<file>…]</literallayout>
\r
19 <simplesect id="git-mergetool(1)__description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>Use <emphasis>git mergetool</emphasis> to run one of several merge utilities to resolve
\r
22 merge conflicts. It is typically run after <emphasis>git merge</emphasis>.</simpara>
\r
23 <simpara>If one or more <file> parameters are given, the merge tool program will
\r
24 be run to resolve differences on each file (skipping those without
\r
25 conflicts). Specifying a directory will include all unresolved files in
\r
26 that path. If no <file> names are specified, <emphasis>git mergetool</emphasis> will run
\r
27 the merge tool program on every file with merge conflicts.</simpara>
\r
29 <simplesect id="git-mergetool(1)__options">
\r
30 <title>OPTIONS</title>
\r
41 Use the merge resolution program specified by <tool>.
\r
42 Valid values include emerge, gvimdiff, kdiff3,
\r
43 meld, vimdiff, and tortoisemerge. Run <emphasis>git mergetool --tool-help</emphasis>
\r
44 for the list of valid <tool> settings.
\r
46 <simpara>If a merge resolution program is not specified, <emphasis>git mergetool</emphasis>
\r
47 will use the configuration variable <emphasis>merge.tool</emphasis>. If the
\r
48 configuration variable <emphasis>merge.tool</emphasis> is not set, <emphasis>git mergetool</emphasis>
\r
49 will pick a suitable default.</simpara>
\r
50 <simpara>You can explicitly provide a full path to the tool by setting the
\r
51 configuration variable <emphasis>mergetool.<tool>.path</emphasis>. For example, you
\r
52 can configure the absolute path to kdiff3 by setting
\r
53 <emphasis>mergetool.kdiff3.path</emphasis>. Otherwise, <emphasis>git mergetool</emphasis> assumes the
\r
54 tool is available in PATH.</simpara>
\r
55 <simpara>Instead of running one of the known merge tool programs,
\r
56 <emphasis>git mergetool</emphasis> can be customized to run an alternative program
\r
57 by specifying the command line to invoke in a configuration
\r
58 variable <emphasis>mergetool.<tool>.cmd</emphasis>.</simpara>
\r
59 <simpara>When <emphasis>git mergetool</emphasis> is invoked with this tool (either through the
\r
60 <emphasis>-t</emphasis> or <emphasis>--tool</emphasis> option or the <emphasis>merge.tool</emphasis> configuration
\r
61 variable) the configured command line will be invoked with <emphasis>$BASE</emphasis>
\r
62 set to the name of a temporary file containing the common base for
\r
63 the merge, if available; <emphasis>$LOCAL</emphasis> set to the name of a temporary
\r
64 file containing the contents of the file on the current branch;
\r
65 <emphasis>$REMOTE</emphasis> set to the name of a temporary file containing the
\r
66 contents of the file to be merged, and <emphasis>$MERGED</emphasis> set to the name
\r
67 of the file to which the merge tool should write the result of the
\r
68 merge resolution.</simpara>
\r
69 <simpara>If the custom merge tool correctly indicates the success of a
\r
70 merge resolution with its exit code, then the configuration
\r
71 variable <emphasis>mergetool.<tool>.trustExitCode</emphasis> can be set to <emphasis>true</emphasis>.
\r
72 Otherwise, <emphasis>git mergetool</emphasis> will prompt the user to indicate the
\r
73 success of the resolution after the custom tool has exited.</simpara>
\r
82 Print a list of merge tools that may be used with <emphasis>--tool</emphasis>.
\r
95 Don't prompt before each invocation of the merge resolution
\r
97 This is the default if the merge resolution program is
\r
98 explicitly specified with the <emphasis>--tool</emphasis> option or with the
\r
99 <emphasis>merge.tool</emphasis> configuration variable.
\r
109 Prompt before each invocation of the merge resolution program
\r
110 to give the user a chance to skip the path.
\r
116 <simplesect id="git-mergetool(1)__temporary_files">
\r
117 <title>TEMPORARY FILES</title>
\r
118 <simpara><emphasis>git mergetool</emphasis> creates <emphasis>*.orig</emphasis> backup files while resolving merges.
\r
119 These are safe to remove once a file has been merged and its
\r
120 <emphasis>git mergetool</emphasis> session has completed.</simpara>
\r
121 <simpara>Setting the <emphasis>mergetool.keepBackup</emphasis> configuration variable to <emphasis>false</emphasis>
\r
122 causes <emphasis>git mergetool</emphasis> to automatically remove the backup as files
\r
123 are successfully merged.</simpara>
\r
125 <simplesect id="git-mergetool(1)__git">
\r
127 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r