2 .\" Title: git-difftool
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.47.1.404.ge66fd72e97
10 .TH "GIT\-DIFFTOOL" "1" "2024-12-06" "Git 2\&.47\&.1\&.404\&.ge66fd7" "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>\&...\:]
39 \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)\&.
44 Copy the modified files to a temporary location and perform a directory diff on them\&. This mode never prompts before launching the diff tool\&.
49 Do not prompt before launching a diff tool\&.
54 Prompt before each invocation of the diff tool\&. This is the default behaviour; the option is provided to override any configuration settings\&.
59 Start showing the diff for the given path, the paths before it will move to the end and output\&.
64 Start showing the diff for the given path, skipping all the paths before it\&.
67 \-t <tool>, \-\-tool=<tool>
69 Use the diff tool specified by <tool>\&. Valid values include emerge, kompare, meld, and vimdiff\&. Run
73 for the list of valid <tool> settings\&.
75 If a diff tool is not specified,
77 will use the configuration variable
78 \fBdiff\&.tool\fR\&. If the configuration variable
82 will pick a suitable default\&.
84 You can explicitly provide a full path to the tool by setting the configuration variable
85 \fBdifftool\&.\fR\fI<tool>\fR\fB\&.path\fR\&. For example, you can configure the absolute path to kdiff3 by setting
86 \fBdifftool\&.kdiff3\&.path\fR\&. Otherwise,
88 assumes the tool is available in PATH\&.
90 Instead of running one of the known diff tools,
92 can be customized to run an alternative program by specifying the command line to invoke in a configuration variable
93 \fBdifftool\&.\fR\fI<tool>\fR\fB\&.cmd\fR\&.
97 is invoked with this tool (either through the
103 configuration variable) the configured command line will be invoked with the following variables available:
105 is set to the name of the temporary file containing the contents of the diff pre\-image and
107 is set to the name of the temporary file containing the contents of the diff post\-image\&.
109 is the name of the file which is being compared\&.
111 is provided for compatibility with custom merge tool commands and has the same value as
117 Print a list of diff tools that may be used with
123 \fIgit difftool\fR\*(Aqs default behavior is to create symlinks to the working tree when run in
125 mode and the right\-hand side of the comparison yields the same content as the file in the working tree\&.
128 \fB\-\-no\-symlinks\fR
131 to create copies instead\&.
132 \fB\-\-no\-symlinks\fR
133 is the default on Windows\&.
136 \-x <command>, \-\-extcmd=<command>
138 Specify a custom command for viewing diffs\&.
140 ignores the configured defaults and runs
144 when this option is specified\&. Additionally,
146 is set in the environment\&.
157 option the default diff tool will be read from the configured
160 \fBdiff\&.tool\fR\&. This may be selected automatically using the configuration variable
161 \fBdifftool\&.guiDefault\fR\&. The
163 option can be used to override these settings\&. If
165 is not set, we will fallback in the order of
166 \fBmerge\&.guitool\fR,
169 until a tool is found\&.
172 \-\-[no\-]trust\-exit\-code
174 Errors reported by the diff tool are ignored by default\&. Use
175 \fB\-\-trust\-exit\-code\fR
178 exit when an invoked diff tool returns a non\-zero exit code\&.
181 will forward the exit code of the invoked tool when
182 \fB\-\-trust\-exit\-code\fR
186 See \fBgit-diff\fR(1) for the full list of supported options\&.
189 \fIgit difftool\fR falls back to \fIgit mergetool\fR config variables when the difftool equivalents have not been defined\&.
191 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:
195 Controls which diff tool is used by
196 \fBgit-difftool\fR(1)\&. This variable overrides the value configured in
197 \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\&.
202 Controls which diff tool is used by
203 \fBgit-difftool\fR(1)
204 when the \-g/\-\-gui flag is specified\&. This variable overrides the value configured in
205 \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\&.
208 difftool\&.<tool>\&.cmd
210 Specify the command to invoke the specified diff tool\&. The specified command is evaluated in shell with the following variables available:
212 is set to the name of the temporary file containing the contents of the diff pre\-image and
214 is set to the name of the temporary file containing the contents of the diff post\-image\&.
217 \fB\-\-tool=\fR\fI<tool>\fR
219 \fBgit-difftool\fR(1)
223 difftool\&.<tool>\&.path
225 Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
228 difftool\&.trustExitCode
230 Exit difftool if the invoked diff tool returns a non\-zero exit status\&.
233 \fB\-\-trust\-exit\-code\fR
235 \fBgit-difftool\fR(1)
241 Prompt before each invocation of the diff tool\&.
244 difftool\&.guiDefault
250 by default (equivalent to specifying the
258 depending on the presence of a
260 environment variable value\&. The default is
261 \fBfalse\fR, where the
263 argument must be provided explicitly for the
271 Show changes between commits, commit and working tree, etc
274 \fBgit-mergetool\fR(1)
276 Run merge conflict resolution tools to resolve merge conflicts
281 Get and set repository or global options
285 Part of the \fBgit\fR(1) suite