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.46.1.603.g94b60adee3
10 .TH "GIT\-DIFFTOOL" "1" "2024-09-20" "Git 2\&.46\&.1\&.603\&.g94b60a" "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
70 \fBgit difftool \-\-tool\-help\fR
71 for the list of valid <tool> settings\&.
73 If a diff tool is not specified,
75 will use the configuration variable
76 \fBdiff\&.tool\fR\&. If the configuration variable
80 will pick a suitable default\&.
82 You can explicitly provide a full path to the tool by setting the configuration variable
83 \fBdifftool\&.<tool>\&.path\fR\&. For example, you can configure the absolute path to kdiff3 by setting
84 \fBdifftool\&.kdiff3\&.path\fR\&. Otherwise,
86 assumes the tool is available in PATH\&.
88 Instead of running one of the known diff tools,
90 can be customized to run an alternative program by specifying the command line to invoke in a configuration variable
91 \fBdifftool\&.<tool>\&.cmd\fR\&.
95 is invoked with this tool (either through the
101 configuration variable) the configured command line will be invoked with the following variables available:
103 is set to the name of the temporary file containing the contents of the diff pre\-image and
105 is set to the name of the temporary file containing the contents of the diff post\-image\&.
107 is the name of the file which is being compared\&.
109 is provided for compatibility with custom merge tool commands and has the same value as
115 Print a list of diff tools that may be used with
121 \fIgit difftool\fR\*(Aqs default behavior is to create symlinks to the working tree when run in
123 mode and the right\-hand side of the comparison yields the same content as the file in the working tree\&.
126 \fB\-\-no\-symlinks\fR
129 to create copies instead\&.
130 \fB\-\-no\-symlinks\fR
131 is the default on Windows\&.
134 \-x <command>, \-\-extcmd=<command>
136 Specify a custom command for viewing diffs\&.
138 ignores the configured defaults and runs
139 \fB<command> $LOCAL $REMOTE\fR
140 when this option is specified\&. Additionally,
142 is set in the environment\&.
153 option the default diff tool will be read from the configured
156 \fBdiff\&.tool\fR\&. This may be selected automatically using the configuration variable
157 \fBdifftool\&.guiDefault\fR\&. The
159 option can be used to override these settings\&. If
161 is not set, we will fallback in the order of
162 \fBmerge\&.guitool\fR,
165 until a tool is found\&.
168 \-\-[no\-]trust\-exit\-code
170 Errors reported by the diff tool are ignored by default\&. Use
171 \fB\-\-trust\-exit\-code\fR
174 exit when an invoked diff tool returns a non\-zero exit code\&.
177 will forward the exit code of the invoked tool when
178 \fB\-\-trust\-exit\-code\fR
182 See \fBgit-diff\fR(1) for the full list of supported options\&.
185 \fIgit difftool\fR falls back to \fIgit mergetool\fR config variables when the difftool equivalents have not been defined\&.
187 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:
191 Controls which diff tool is used by
192 \fBgit-difftool\fR(1)\&. This variable overrides the value configured in
193 \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\&.
198 Controls which diff tool is used by
199 \fBgit-difftool\fR(1)
200 when the \-g/\-\-gui flag is specified\&. This variable overrides the value configured in
201 \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\&.
204 difftool\&.<tool>\&.cmd
206 Specify the command to invoke the specified diff tool\&. The specified command is evaluated in shell with the following variables available:
208 is set to the name of the temporary file containing the contents of the diff pre\-image and
210 is set to the name of the temporary file containing the contents of the diff post\-image\&.
213 \fB\-\-tool=<tool>\fR
215 \fBgit-difftool\fR(1)
219 difftool\&.<tool>\&.path
221 Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
224 difftool\&.trustExitCode
226 Exit difftool if the invoked diff tool returns a non\-zero exit status\&.
229 \fB\-\-trust\-exit\-code\fR
231 \fBgit-difftool\fR(1)
237 Prompt before each invocation of the diff tool\&.
240 difftool\&.guiDefault
246 by default (equivalent to specifying the
254 depending on the presence of a
256 environment variable value\&. The default is
257 \fBfalse\fR, where the
259 argument must be provided explicitly for the
267 Show changes between commits, commit and working tree, etc
270 \fBgit-mergetool\fR(1)
272 Run merge conflict resolution tools to resolve merge conflicts
277 Get and set repository or global options
281 Part of the \fBgit\fR(1) suite