2 .\" Title: git-difftool
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.42.0.rc0
10 .TH "GIT\-DIFFTOOL" "1" "2023\-08\-04" "Git 2\&.42\&.0\&.rc0" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-difftool \- Show changes using common diff tools
35 \fIgit difftool\fR [<options>] [<commit> [<commit>]] [\-\-] [<path>\&...]
40 \fIgit difftool\fR is a Git command that allows you to compare and edit files between revisions using common diff tools\&. \fIgit difftool\fR is a frontend to \fIgit diff\fR and accepts the same options and arguments\&. See \fBgit-diff\fR(1)\&.
45 Copy the modified files to a temporary location and perform a directory diff on them\&. This mode never prompts before launching the diff tool\&.
50 Do not prompt before launching a diff tool\&.
55 Prompt before each invocation of the diff tool\&. This is the default behaviour; the option is provided to override any configuration settings\&.
60 Start showing the diff for the given path, the paths before it will move to end and output\&.
65 Start showing the diff for the given path, skipping all the paths before it\&.
68 \-t <tool>, \-\-tool=<tool>
70 Use the diff tool specified by <tool>\&. Valid values include emerge, kompare, meld, and vimdiff\&. Run
71 \fBgit difftool \-\-tool\-help\fR
72 for the list of valid <tool> settings\&.
74 If a diff tool is not specified,
76 will use the configuration variable
77 \fBdiff\&.tool\fR\&. If the configuration variable
81 will pick a suitable default\&.
83 You can explicitly provide a full path to the tool by setting the configuration variable
84 \fBdifftool\&.<tool>\&.path\fR\&. For example, you can configure the absolute path to kdiff3 by setting
85 \fBdifftool\&.kdiff3\&.path\fR\&. Otherwise,
87 assumes the tool is available in PATH\&.
89 Instead of running one of the known diff tools,
91 can be customized to run an alternative program by specifying the command line to invoke in a configuration variable
92 \fBdifftool\&.<tool>\&.cmd\fR\&.
96 is invoked with this tool (either through the
102 configuration variable) the configured command line will be invoked with the following variables available:
104 is set to the name of the temporary file containing the contents of the diff pre\-image and
106 is set to the name of the temporary file containing the contents of the diff post\-image\&.
108 is the name of the file which is being compared\&.
110 is provided for compatibility with custom merge tool commands and has the same value as
116 Print a list of diff tools that may be used with
122 \fIgit difftool\fR\*(Aqs default behavior is create symlinks to the working tree when run in
124 mode and the right\-hand side of the comparison yields the same content as the file in the working tree\&.
127 \fB\-\-no\-symlinks\fR
130 to create copies instead\&.
131 \fB\-\-no\-symlinks\fR
132 is the default on Windows\&.
135 \-x <command>, \-\-extcmd=<command>
137 Specify a custom command for viewing diffs\&.
139 ignores the configured defaults and runs
140 \fB$command $LOCAL $REMOTE\fR
141 when this option is specified\&. Additionally,
143 is set in the environment\&.
154 option the default diff tool will be read from the configured
157 \fBdiff\&.tool\fR\&. This may be selected automatically using the configuration variable
158 \fBdifftool\&.guiDefault\fR\&. The
160 option can be used to override these settings\&. If
162 is not set, we will fallback in the order of
163 \fBmerge\&.guitool\fR,
166 until a tool is found\&.
169 \-\-[no\-]trust\-exit\-code
172 invokes a diff tool individually on each file\&. Errors reported by the diff tool are ignored by default\&. Use
173 \fB\-\-trust\-exit\-code\fR
176 exit when an invoked diff tool returns a non\-zero exit code\&.
179 will forward the exit code of the invoked tool when
180 \fB\-\-trust\-exit\-code\fR
184 See \fBgit-diff\fR(1) for the full list of supported options\&.
187 \fIgit difftool\fR falls back to \fIgit mergetool\fR config variables when the difftool equivalents have not been defined\&.
189 Everything above this line in this section isn\(cqt included from the \fBgit-config\fR(1) documentation\&. The content that follows is the same as what\(cqs found there:
193 Controls which diff tool is used by
194 \fBgit-difftool\fR(1)\&. This variable overrides the value configured in
195 \fBmerge\&.tool\fR\&. The list below shows the valid built\-in values\&. Any other value is treated as a custom diff tool and requires that a corresponding difftool\&.<tool>\&.cmd variable is defined\&.
200 Controls which diff tool is used by
201 \fBgit-difftool\fR(1)
202 when the \-g/\-\-gui flag is specified\&. This variable overrides the value configured in
203 \fBmerge\&.guitool\fR\&. The list below shows the valid built\-in values\&. Any other value is treated as a custom diff tool and requires that a corresponding difftool\&.<guitool>\&.cmd variable is defined\&.
206 difftool\&.<tool>\&.cmd
208 Specify the command to invoke the specified diff tool\&. The specified command is evaluated in shell with the following variables available:
210 is set to the name of the temporary file containing the contents of the diff pre\-image and
212 is set to the name of the temporary file containing the contents of the diff post\-image\&.
215 \fB\-\-tool=<tool>\fR
217 \fBgit-difftool\fR(1)
221 difftool\&.<tool>\&.path
223 Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
226 difftool\&.trustExitCode
228 Exit difftool if the invoked diff tool returns a non\-zero exit status\&.
231 \fB\-\-trust\-exit\-code\fR
233 \fBgit-difftool\fR(1)
239 Prompt before each invocation of the diff tool\&.
242 difftool\&.guiDefault
248 by default (equivalent to specifying the
256 depending on the presence of a
258 environment variable value\&. The default is
259 \fBfalse\fR, where the
261 argument must be provided explicitly for the
269 Show changes between commits, commit and working tree, etc
272 \fBgit-mergetool\fR(1)
274 Run merge conflict resolution tools to resolve merge conflicts
279 Get and set repository or global options
283 Part of the \fBgit\fR(1) suite