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

CONFIG VARIABLES

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

SEE ALSO

124       git-diff(1)
125           Show changes between commits, commit and working tree, etc
126
127       git-mergetool(1)
128           Run merge conflict resolution tools to resolve merge conflicts
129
130       git-config(1)
131           Get and set repository or global options
132

GIT

134       Part of the git(1) suite
135
136
137
138Git 2.26.2                        2020-04-20                   GIT-DIFFTOOL(1)
Impressum