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-difftool(1)">
\r
6 <title>git-difftool(1)</title>
\r
8 <primary>git-difftool(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-difftool - Show changes using common diff tools</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git difftool</emphasis> [<options>] [<commit> [<commit>]] [--] [<path>…]</literallayout>
\r
21 <simplesect id="_description">
\r
22 <title>DESCRIPTION</title>
\r
23 <simpara><emphasis>git difftool</emphasis> is a git command that allows you to compare and edit files
\r
24 between revisions using common diff tools. <emphasis>git difftool</emphasis> is a frontend
\r
25 to <emphasis>git diff</emphasis> and accepts the same options and arguments. See
\r
26 <xref linkend="git-diff(1)" />.</simpara>
\r
28 <simplesect id="_options">
\r
29 <title>OPTIONS</title>
\r
40 Do not prompt before launching a diff tool.
\r
50 Prompt before each invocation of the diff tool.
\r
51 This is the default behaviour; the option is provided to
\r
52 override any configuration settings.
\r
65 Use the diff tool specified by <tool>.
\r
66 Valid diff tools are:
\r
67 araxis, bc3, deltawalker, diffuse, emerge, ecmerge, gvimdiff,
\r
68 kdiff3, kompare, meld, opendiff, p4merge, tkdiff, vimdiff and
\r
71 <simpara>If a diff tool is not specified, <emphasis>git difftool</emphasis>
\r
72 will use the configuration variable <emphasis>diff.tool</emphasis>. If the
\r
73 configuration variable <emphasis>diff.tool</emphasis> is not set, <emphasis>git difftool</emphasis>
\r
74 will pick a suitable default.</simpara>
\r
75 <simpara>You can explicitly provide a full path to the tool by setting the
\r
76 configuration variable <emphasis>difftool.<tool>.path</emphasis>. For example, you
\r
77 can configure the absolute path to kdiff3 by setting
\r
78 <emphasis>difftool.kdiff3.path</emphasis>. Otherwise, <emphasis>git difftool</emphasis> assumes the
\r
79 tool is available in PATH.</simpara>
\r
80 <simpara>Instead of running one of the known diff tools,
\r
81 <emphasis>git difftool</emphasis> can be customized to run an alternative program
\r
82 by specifying the command line to invoke in a configuration
\r
83 variable <emphasis>difftool.<tool>.cmd</emphasis>.</simpara>
\r
84 <simpara>When <emphasis>git difftool</emphasis> is invoked with this tool (either through the
\r
85 <emphasis>-t</emphasis> or <emphasis>--tool</emphasis> option or the <emphasis>diff.tool</emphasis> configuration variable)
\r
86 the configured command line will be invoked with the following
\r
87 variables available: <emphasis>$LOCAL</emphasis> is set to the name of the temporary
\r
88 file containing the contents of the diff pre-image and <emphasis>$REMOTE</emphasis>
\r
89 is set to the name of the temporary file containing the contents
\r
90 of the diff post-image. <emphasis>$MERGED</emphasis> is the name of the file which is
\r
91 being compared. <emphasis>$BASE</emphasis> is provided for compatibility
\r
92 with custom merge tool commands and has the same value as <emphasis>$MERGED</emphasis>.</simpara>
\r
100 --extcmd=<command>
\r
104 Specify a custom command for viewing diffs.
\r
105 <emphasis>git-difftool</emphasis> ignores the configured defaults and runs
\r
106 <emphasis>$command $LOCAL $REMOTE</emphasis> when this option is specified.
\r
107 Additionally, <emphasis>$BASE</emphasis> is set in the environment.
\r
120 When <emphasis>git-difftool</emphasis> is invoked with the <emphasis>-g</emphasis> or <emphasis>--gui</emphasis> option
\r
121 the default diff tool will be read from the configured
\r
122 <emphasis>diff.guitool</emphasis> variable instead of <emphasis>diff.tool</emphasis>.
\r
127 <simpara>See <xref linkend="git-diff(1)" /> for the full list of supported options.</simpara>
\r
129 <simplesect id="_config_variables">
\r
130 <title>CONFIG VARIABLES</title>
\r
131 <simpara><emphasis>git difftool</emphasis> falls back to <emphasis>git mergetool</emphasis> config variables when the
\r
132 difftool equivalents have not been defined.</simpara>
\r
140 The default diff tool to use.
\r
150 The default diff tool to use when <emphasis>--gui</emphasis> is specified.
\r
156 difftool.<tool>.path
\r
160 Override the path for the given tool. This is useful in case
\r
161 your tool is not in the PATH.
\r
167 difftool.<tool>.cmd
\r
171 Specify the command to invoke the specified diff tool.
\r
173 <simpara>See the <emphasis>--tool=<tool></emphasis> option above for more details.</simpara>
\r
182 Prompt before each invocation of the diff tool.
\r
188 <simplesect id="_see_also">
\r
189 <title>SEE ALSO</title>
\r
193 <xref linkend="git-diff(1)" />
\r
197 Show changes between commits, commit and working tree, etc
\r
203 <xref linkend="git-mergetool(1)" />
\r
207 Run merge conflict resolution tools to resolve merge conflicts
\r
213 <xref linkend="git-config(1)" />
\r
217 Get and set repository or global options
\r
223 <simplesect id="_git">
\r
225 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r