1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/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
18 <literallayout><emphasis>git mergetool</emphasis> [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>…]</literallayout>
\r
21 <simplesect id="_description">
\r
22 <title>DESCRIPTION</title>
\r
23 <simpara>Use <emphasis>git mergetool</emphasis> to run one of several merge utilities to resolve
\r
24 merge conflicts. It is typically run after <emphasis>git merge</emphasis>.</simpara>
\r
25 <simpara>If one or more <file> parameters are given, the merge tool program will
\r
26 be run to resolve differences on each file (skipping those without
\r
27 conflicts). Specifying a directory will include all unresolved files in
\r
28 that path. If no <file> names are specified, <emphasis>git mergetool</emphasis> will run
\r
29 the merge tool program on every file with merge conflicts.</simpara>
\r
31 <simplesect id="_options">
\r
32 <title>OPTIONS</title>
\r
43 Use the merge resolution program specified by <tool>.
\r
44 Valid merge tools are:
\r
45 araxis, bc3, diffuse, ecmerge, emerge, gvimdiff, kdiff3,
\r
46 meld, opendiff, p4merge, tkdiff, tortoisemerge, vimdiff and xxdiff.
\r
48 <simpara>If a merge resolution program is not specified, <emphasis>git mergetool</emphasis>
\r
49 will use the configuration variable <emphasis>merge.tool</emphasis>. If the
\r
50 configuration variable <emphasis>merge.tool</emphasis> is not set, <emphasis>git mergetool</emphasis>
\r
51 will pick a suitable default.</simpara>
\r
52 <simpara>You can explicitly provide a full path to the tool by setting the
\r
53 configuration variable <emphasis>mergetool.<tool>.path</emphasis>. For example, you
\r
54 can configure the absolute path to kdiff3 by setting
\r
55 <emphasis>mergetool.kdiff3.path</emphasis>. Otherwise, <emphasis>git mergetool</emphasis> assumes the
\r
56 tool is available in PATH.</simpara>
\r
57 <simpara>Instead of running one of the known merge tool programs,
\r
58 <emphasis>git mergetool</emphasis> can be customized to run an alternative program
\r
59 by specifying the command line to invoke in a configuration
\r
60 variable <emphasis>mergetool.<tool>.cmd</emphasis>.</simpara>
\r
61 <simpara>When <emphasis>git mergetool</emphasis> is invoked with this tool (either through the
\r
62 <emphasis>-t</emphasis> or <emphasis>--tool</emphasis> option or the <emphasis>merge.tool</emphasis> configuration
\r
63 variable) the configured command line will be invoked with <emphasis>$BASE</emphasis>
\r
64 set to the name of a temporary file containing the common base for
\r
65 the merge, if available; <emphasis>$LOCAL</emphasis> set to the name of a temporary
\r
66 file containing the contents of the file on the current branch;
\r
67 <emphasis>$REMOTE</emphasis> set to the name of a temporary file containing the
\r
68 contents of the file to be merged, and <emphasis>$MERGED</emphasis> set to the name
\r
69 of the file to which the merge tool should write the result of the
\r
70 merge resolution.</simpara>
\r
71 <simpara>If the custom merge tool correctly indicates the success of a
\r
72 merge resolution with its exit code, then the configuration
\r
73 variable <emphasis>mergetool.<tool>.trustExitCode</emphasis> can be set to <emphasis>true</emphasis>.
\r
74 Otherwise, <emphasis>git mergetool</emphasis> will prompt the user to indicate the
\r
75 success of the resolution after the custom tool has exited.</simpara>
\r
87 Don't prompt before each invocation of the merge resolution
\r
98 Prompt before each invocation of the merge resolution program.
\r
99 This is the default behaviour; the option is provided to
\r
100 override any configuration settings.
\r
106 <simplesect id="_temporary_files">
\r
107 <title>TEMPORARY FILES</title>
\r
108 <simpara><emphasis>git mergetool</emphasis> creates <emphasis>*.orig</emphasis> backup files while resolving merges.
\r
109 These are safe to remove once a file has been merged and its
\r
110 <emphasis>git mergetool</emphasis> session has completed.</simpara>
\r
111 <simpara>Setting the <emphasis>mergetool.keepBackup</emphasis> configuration variable to <emphasis>false</emphasis>
\r
112 causes <emphasis>git mergetool</emphasis> to automatically remove the backup as files
\r
113 are successfully merged.</simpara>
\r
115 <simplesect id="_git">
\r
117 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r