1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-mergetool(1)">
\r
6 <title>git-mergetool(1)</title>
\r
8 <primary>git-mergetool(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-mergetool - Run merge conflict resolution tools to resolve merge conflicts</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
17 <simpara><emphasis>git mergetool</emphasis> [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]…</simpara>
\r
19 <simplesect id="_description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>Use <literal>git mergetool</literal> 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. If no <file> names are
\r
25 specified, <emphasis>git-mergetool</emphasis> will run the merge tool program on every file
\r
26 with merge conflicts.</simpara>
\r
28 <simplesect id="_options">
\r
29 <title>OPTIONS</title>
\r
40 Use the merge resolution program specified by <tool>.
\r
41 Valid merge tools are:
\r
42 kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff
\r
44 <simpara>If a merge resolution program is not specified, <emphasis>git-mergetool</emphasis>
\r
45 will use the configuration variable <literal>merge.tool</literal>. If the
\r
46 configuration variable <literal>merge.tool</literal> is not set, <emphasis>git-mergetool</emphasis>
\r
47 will pick a suitable default.</simpara>
\r
48 <simpara>You can explicitly provide a full path to the tool by setting the
\r
49 configuration variable <literal>mergetool.<tool>.path</literal>. For example, you
\r
50 can configure the absolute path to kdiff3 by setting
\r
51 <literal>mergetool.kdiff3.path</literal>. Otherwise, <emphasis>git-mergetool</emphasis> assumes the
\r
52 tool is available in PATH.</simpara>
\r
53 <simpara>Instead of running one of the known merge tool programs,
\r
54 <emphasis>git-mergetool</emphasis> can be customized to run an alternative program
\r
55 by specifying the command line to invoke in a configuration
\r
56 variable <literal>mergetool.<tool>.cmd</literal>.</simpara>
\r
57 <simpara>When <emphasis>git-mergetool</emphasis> is invoked with this tool (either through the
\r
58 <literal>-t</literal> or <literal>--tool</literal> option or the <literal>merge.tool</literal> configuration
\r
59 variable) the configured command line will be invoked with <literal>$BASE</literal>
\r
60 set to the name of a temporary file containing the common base for
\r
61 the merge, if available; <literal>$LOCAL</literal> set to the name of a temporary
\r
62 file containing the contents of the file on the current branch;
\r
63 <literal>$REMOTE</literal> set to the name of a temporary file containing the
\r
64 contents of the file to be merged, and <literal>$MERGED</literal> set to the name
\r
65 of the file to which the merge tool should write the result of the
\r
66 merge resolution.</simpara>
\r
67 <simpara>If the custom merge tool correctly indicates the success of a
\r
68 merge resolution with its exit code, then the configuration
\r
69 variable <literal>mergetool.<tool>.trustExitCode</literal> can be set to <literal>true</literal>.
\r
70 Otherwise, <emphasis>git-mergetool</emphasis> will prompt the user to indicate the
\r
71 success of the resolution after the custom tool has exited.</simpara>
\r
83 Don’t prompt before each invocation of the merge resolution
\r
94 Prompt before each invocation of the merge resolution program.
\r
95 This is the default behaviour; the option is provided to
\r
96 override any configuration settings.
\r
102 <simplesect id="_author">
\r
103 <title>Author</title>
\r
104 <simpara>Written by Theodore Y Ts’o <<ulink url="mailto:tytso@mit.edu">tytso@mit.edu</ulink>></simpara>
\r
106 <simplesect id="_documentation">
\r
107 <title>Documentation</title>
\r
108 <simpara>Documentation by Theodore Y Ts’o.</simpara>
\r
110 <simplesect id="_git">
\r
112 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r