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.44.0.191.g945115026a
10 .TH "GIT\-DIFFTOOL" "1" "2024\-03\-11" "Git 2\&.44\&.0\&.191\&.g945115" "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 the 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 to 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
171 Errors reported by the diff tool are ignored by default\&. Use
172 \fB\-\-trust\-exit\-code\fR
175 exit when an invoked diff tool returns a non\-zero exit code\&.
178 will forward the exit code of the invoked tool when
179 \fB\-\-trust\-exit\-code\fR
183 See \fBgit-diff\fR(1) for the full list of supported options\&.
186 \fIgit difftool\fR falls back to \fIgit mergetool\fR config variables when the difftool equivalents have not been defined\&.
188 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:
192 Controls which diff tool is used by
193 \fBgit-difftool\fR(1)\&. This variable overrides the value configured in
194 \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\&.
199 Controls which diff tool is used by
200 \fBgit-difftool\fR(1)
201 when the \-g/\-\-gui flag is specified\&. This variable overrides the value configured in
202 \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\&.
205 difftool\&.<tool>\&.cmd
207 Specify the command to invoke the specified diff tool\&. The specified command is evaluated in shell with the following variables available:
209 is set to the name of the temporary file containing the contents of the diff pre\-image and
211 is set to the name of the temporary file containing the contents of the diff post\-image\&.
214 \fB\-\-tool=<tool>\fR
216 \fBgit-difftool\fR(1)
220 difftool\&.<tool>\&.path
222 Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
225 difftool\&.trustExitCode
227 Exit difftool if the invoked diff tool returns a non\-zero exit status\&.
230 \fB\-\-trust\-exit\-code\fR
232 \fBgit-difftool\fR(1)
238 Prompt before each invocation of the diff tool\&.
241 difftool\&.guiDefault
247 by default (equivalent to specifying the
255 depending on the presence of a
257 environment variable value\&. The default is
258 \fBfalse\fR, where the
260 argument must be provided explicitly for the
268 Show changes between commits, commit and working tree, etc
271 \fBgit-mergetool\fR(1)
273 Run merge conflict resolution tools to resolve merge conflicts
278 Get and set repository or global options
282 Part of the \fBgit\fR(1) suite