Autogenerated manpages for v2.47.1-404-ge66fd7
[git-manpages.git] / man1 / git-difftool.1
blobf1f4067aa858052d0c29daeab035747548b040ba
1 '\" t
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/>
5 .\"      Date: 2024-12-06
6 .\"    Manual: Git Manual
7 .\"    Source: Git 2.47.1.404.ge66fd72e97
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 git-difftool \- Show changes using common diff tools
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 \fIgit difftool\fR [<options>] [<commit> [<commit>]] [\-\-] [<path>\&...\:]
36 .fi
37 .SH "DESCRIPTION"
38 .sp
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)\&.
40 .SH "OPTIONS"
41 .PP
42 \-d, \-\-dir\-diff
43 .RS 4
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\&.
45 .RE
46 .PP
47 \-y, \-\-no\-prompt
48 .RS 4
49 Do not prompt before launching a diff tool\&.
50 .RE
51 .PP
52 \-\-prompt
53 .RS 4
54 Prompt before each invocation of the diff tool\&. This is the default behaviour; the option is provided to override any configuration settings\&.
55 .RE
56 .PP
57 \-\-rotate\-to=<file>
58 .RS 4
59 Start showing the diff for the given path, the paths before it will move to the end and output\&.
60 .RE
61 .PP
62 \-\-skip\-to=<file>
63 .RS 4
64 Start showing the diff for the given path, skipping all the paths before it\&.
65 .RE
66 .PP
67 \-t <tool>, \-\-tool=<tool>
68 .RS 4
69 Use the diff tool specified by <tool>\&. Valid values include emerge, kompare, meld, and vimdiff\&. Run
70 \fBgit\fR
71 \fBdifftool\fR
72 \fB\-\-tool\-help\fR
73 for the list of valid <tool> settings\&.
74 .sp
75 If a diff tool is not specified,
76 \fIgit difftool\fR
77 will use the configuration variable
78 \fBdiff\&.tool\fR\&. If the configuration variable
79 \fBdiff\&.tool\fR
80 is not set,
81 \fIgit difftool\fR
82 will pick a suitable default\&.
83 .sp
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,
87 \fIgit difftool\fR
88 assumes the tool is available in PATH\&.
89 .sp
90 Instead of running one of the known diff tools,
91 \fIgit difftool\fR
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\&.
94 .sp
95 When
96 \fIgit difftool\fR
97 is invoked with this tool (either through the
98 \fB\-t\fR
100 \fB\-\-tool\fR
101 option or the
102 \fBdiff\&.tool\fR
103 configuration variable) the configured command line will be invoked with the following variables available:
104 \fB$LOCAL\fR
105 is set to the name of the temporary file containing the contents of the diff pre\-image and
106 \fB$REMOTE\fR
107 is set to the name of the temporary file containing the contents of the diff post\-image\&.
108 \fB$MERGED\fR
109 is the name of the file which is being compared\&.
110 \fB$BASE\fR
111 is provided for compatibility with custom merge tool commands and has the same value as
112 \fB$MERGED\fR\&.
115 \-\-tool\-help
116 .RS 4
117 Print a list of diff tools that may be used with
118 \fB\-\-tool\fR\&.
121 \-\-[no\-]symlinks
122 .RS 4
123 \fIgit difftool\fR\*(Aqs default behavior is to create symlinks to the working tree when run in
124 \fB\-\-dir\-diff\fR
125 mode and the right\-hand side of the comparison yields the same content as the file in the working tree\&.
127 Specifying
128 \fB\-\-no\-symlinks\fR
129 instructs
130 \fIgit difftool\fR
131 to create copies instead\&.
132 \fB\-\-no\-symlinks\fR
133 is the default on Windows\&.
136 \-x <command>, \-\-extcmd=<command>
137 .RS 4
138 Specify a custom command for viewing diffs\&.
139 \fIgit\-difftool\fR
140 ignores the configured defaults and runs
141 \fI<command>\fR
142 \fB$LOCAL\fR
143 \fB$REMOTE\fR
144 when this option is specified\&. Additionally,
145 \fB$BASE\fR
146 is set in the environment\&.
149 \-g, \-\-[no\-]gui
150 .RS 4
151 When
152 \fIgit\-difftool\fR
153 is invoked with the
154 \fB\-g\fR
156 \fB\-\-gui\fR
157 option the default diff tool will be read from the configured
158 \fBdiff\&.guitool\fR
159 variable instead of
160 \fBdiff\&.tool\fR\&. This may be selected automatically using the configuration variable
161 \fBdifftool\&.guiDefault\fR\&. The
162 \fB\-\-no\-gui\fR
163 option can be used to override these settings\&. If
164 \fBdiff\&.guitool\fR
165 is not set, we will fallback in the order of
166 \fBmerge\&.guitool\fR,
167 \fBdiff\&.tool\fR,
168 \fBmerge\&.tool\fR
169 until a tool is found\&.
172 \-\-[no\-]trust\-exit\-code
173 .RS 4
174 Errors reported by the diff tool are ignored by default\&. Use
175 \fB\-\-trust\-exit\-code\fR
176 to make
177 \fIgit\-difftool\fR
178 exit when an invoked diff tool returns a non\-zero exit code\&.
180 \fIgit\-difftool\fR
181 will forward the exit code of the invoked tool when
182 \fB\-\-trust\-exit\-code\fR
183 is used\&.
186 See \fBgit-diff\fR(1) for the full list of supported options\&.
187 .SH "CONFIGURATION"
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:
193 diff\&.tool
194 .RS 4
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\&.
200 diff\&.guitool
201 .RS 4
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
209 .RS 4
210 Specify the command to invoke the specified diff tool\&. The specified command is evaluated in shell with the following variables available:
211 \fILOCAL\fR
212 is set to the name of the temporary file containing the contents of the diff pre\-image and
213 \fIREMOTE\fR
214 is set to the name of the temporary file containing the contents of the diff post\-image\&.
216 See the
217 \fB\-\-tool=\fR\fI<tool>\fR
218 option in
219 \fBgit-difftool\fR(1)
220 for more details\&.
223 difftool\&.<tool>\&.path
224 .RS 4
225 Override the path for the given tool\&. This is useful in case your tool is not in the PATH\&.
228 difftool\&.trustExitCode
229 .RS 4
230 Exit difftool if the invoked diff tool returns a non\-zero exit status\&.
232 See the
233 \fB\-\-trust\-exit\-code\fR
234 option in
235 \fBgit-difftool\fR(1)
236 for more details\&.
239 difftool\&.prompt
240 .RS 4
241 Prompt before each invocation of the diff tool\&.
244 difftool\&.guiDefault
245 .RS 4
247 \fBtrue\fR
248 to use the
249 \fBdiff\&.guitool\fR
250 by default (equivalent to specifying the
251 \fB\-\-gui\fR
252 argument), or
253 \fBauto\fR
254 to select
255 \fBdiff\&.guitool\fR
257 \fBdiff\&.tool\fR
258 depending on the presence of a
259 \fBDISPLAY\fR
260 environment variable value\&. The default is
261 \fBfalse\fR, where the
262 \fB\-\-gui\fR
263 argument must be provided explicitly for the
264 \fBdiff\&.guitool\fR
265 to be used\&.
267 .SH "SEE ALSO"
269 \fBgit-diff\fR(1)
270 .RS 4
271 Show changes between commits, commit and working tree, etc
274 \fBgit-mergetool\fR(1)
275 .RS 4
276 Run merge conflict resolution tools to resolve merge conflicts
279 \fBgit-config\fR(1)
280 .RS 4
281 Get and set repository or global options
283 .SH "GIT"
285 Part of the \fBgit\fR(1) suite