1GIT-DIFFTOOL(1)                   Git Manual                   GIT-DIFFTOOL(1)
2
3
4

NAME

6       git-difftool - Show changes using common diff tools
7

SYNOPSIS

9       git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]
10

DESCRIPTION

12       git difftool is a Git command that allows you to compare and edit files
13       between revisions using common diff tools. git difftool is a frontend
14       to git diff and accepts the same options and arguments. See git-
15       diff(1).
16

OPTIONS

18       -d, --dir-diff
19           Copy the modified files to a temporary location and perform a
20           directory diff on them. This mode never prompts before launching
21           the diff tool.
22
23       -y, --no-prompt
24           Do not prompt before launching a diff tool.
25
26       --prompt
27           Prompt before each invocation of the diff tool. This is the default
28           behaviour; the option is provided to override any configuration
29           settings.
30
31       --rotate-to=<file>
32           Start showing the diff for the given path, the paths before it will
33           move to end and output.
34
35       --skip-to=<file>
36           Start showing the diff for the given path, skipping all the paths
37           before it.
38
39       -t <tool>, --tool=<tool>
40           Use the diff tool specified by <tool>. Valid values include emerge,
41           kompare, meld, and vimdiff. Run git difftool --tool-help for the
42           list of valid <tool> settings.
43
44           If a diff tool is not specified, git difftool will use the
45           configuration variable diff.tool. If the configuration variable
46           diff.tool is not set, git difftool will pick a suitable default.
47
48           You can explicitly provide a full path to the tool by setting the
49           configuration variable difftool.<tool>.path. For example, you can
50           configure the absolute path to kdiff3 by setting
51           difftool.kdiff3.path. Otherwise, git difftool assumes the tool is
52           available in PATH.
53
54           Instead of running one of the known diff tools, git difftool can be
55           customized to run an alternative program by specifying the command
56           line to invoke in a configuration variable difftool.<tool>.cmd.
57
58           When git difftool is invoked with this tool (either through the -t
59           or --tool option or the diff.tool configuration variable) the
60           configured command line will be invoked with the following
61           variables available: $LOCAL is set to the name of the temporary
62           file containing the contents of the diff pre-image and $REMOTE is
63           set to the name of the temporary file containing the contents of
64           the diff post-image.  $MERGED is the name of the file which is
65           being compared.  $BASE is provided for compatibility with custom
66           merge tool commands and has the same value as $MERGED.
67
68       --tool-help
69           Print a list of diff tools that may be used with --tool.
70
71       --[no-]symlinks
72           git difftool's default behavior is create symlinks to the working
73           tree when run in --dir-diff mode and the right-hand side of the
74           comparison yields the same content as the file in the working tree.
75
76           Specifying --no-symlinks instructs git difftool to create copies
77           instead.  --no-symlinks is the default on Windows.
78
79       -x <command>, --extcmd=<command>
80           Specify a custom command for viewing diffs.  git-difftool ignores
81           the configured defaults and runs $command $LOCAL $REMOTE when this
82           option is specified. Additionally, $BASE is set in the environment.
83
84       -g, --[no-]gui
85           When git-difftool is invoked with the -g or --gui option the
86           default diff tool will be read from the configured diff.guitool
87           variable instead of diff.tool. The --no-gui option can be used to
88           override this setting. If diff.guitool is not set, we will fallback
89           in the order of merge.guitool, diff.tool, merge.tool until a tool
90           is found.
91
92       --[no-]trust-exit-code
93           git-difftool invokes a diff tool individually on each file. Errors
94           reported by the diff tool are ignored by default. Use
95           --trust-exit-code to make git-difftool exit when an invoked diff
96           tool returns a non-zero exit code.
97
98           git-difftool will forward the exit code of the invoked tool when
99           --trust-exit-code is used.
100
101       See git-diff(1) for the full list of supported options.
102

CONFIG VARIABLES

104       git difftool falls back to git mergetool config variables when the
105       difftool equivalents have not been defined.
106
107       diff.tool
108           The default diff tool to use.
109
110       diff.guitool
111           The default diff tool to use when --gui is specified.
112
113       difftool.<tool>.path
114           Override the path for the given tool. This is useful in case your
115           tool is not in the PATH.
116
117       difftool.<tool>.cmd
118           Specify the command to invoke the specified diff tool.
119
120           See the --tool=<tool> option above for more details.
121
122       difftool.prompt
123           Prompt before each invocation of the diff tool.
124
125       difftool.trustExitCode
126           Exit difftool if the invoked diff tool returns a non-zero exit
127           status.
128
129           See the --trust-exit-code option above for more details.
130

SEE ALSO

132       git-diff(1)
133           Show changes between commits, commit and working tree, etc
134
135       git-mergetool(1)
136           Run merge conflict resolution tools to resolve merge conflicts
137
138       git-config(1)
139           Get and set repository or global options
140

GIT

142       Part of the git(1) suite
143
144
145
146Git 2.33.1                        2021-10-12                   GIT-DIFFTOOL(1)
Impressum