blob: 19d473c070c4f82dc4b7f04f784bcae835dca6a2 [file] [log] [blame]
Junio C Hamano3bd66e92009-04-18 06:17:561git-difftool(1)
2===============
3
4NAME
5----
6git-difftool - Show changes using common diff tools
7
8SYNOPSIS
9--------
Junio C Hamano15567bc2011-07-23 00:51:5910[verse]
Junio C Hamano2e6ded82010-12-05 06:20:4811'git difftool' [<options>] [<commit> [<commit>]] [--] [<path>...]
Junio C Hamano3bd66e92009-04-18 06:17:5612
13DESCRIPTION
14-----------
Junio C Hamano1aa40d22010-01-21 17:46:4315'git difftool' is a git command that allows you to compare and edit files
Junio C Hamano3bd66e92009-04-18 06:17:5616between revisions using common diff tools. 'git difftool' is a frontend
Junio C Hamano2e6ded82010-12-05 06:20:4817to 'git diff' and accepts the same options and arguments. See
18linkgit:git-diff[1].
Junio C Hamano3bd66e92009-04-18 06:17:5619
20OPTIONS
21-------
22-y::
23--no-prompt::
24Do not prompt before launching a diff tool.
25
26--prompt::
27Prompt before each invocation of the diff tool.
28This is the default behaviour; the option is provided to
29override any configuration settings.
30
31-t <tool>::
32--tool=<tool>::
33Use the diff tool specified by <tool>.
Junio C Hamanof0944d02011-11-30 20:46:2934Valid diff tools are:
Junio C Hamanod2c978f2011-03-20 19:42:2235araxis, bc3, diffuse, emerge, ecmerge, gvimdiff, kdiff3,
36kompare, meld, opendiff, p4merge, tkdiff, vimdiff and xxdiff.
Junio C Hamano3bd66e92009-04-18 06:17:5637+
Junio C Hamano1aa40d22010-01-21 17:46:4338If a diff tool is not specified, 'git difftool'
Junio C Hamano3bd66e92009-04-18 06:17:5639will use the configuration variable `diff.tool`. If the
Junio C Hamano1aa40d22010-01-21 17:46:4340configuration variable `diff.tool` is not set, 'git difftool'
Junio C Hamano3bd66e92009-04-18 06:17:5641will pick a suitable default.
42+
43You can explicitly provide a full path to the tool by setting the
44configuration variable `difftool.<tool>.path`. For example, you
45can configure the absolute path to kdiff3 by setting
Junio C Hamano1aa40d22010-01-21 17:46:4346`difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the
Junio C Hamano3bd66e92009-04-18 06:17:5647tool is available in PATH.
48+
49Instead of running one of the known diff tools,
Junio C Hamano1aa40d22010-01-21 17:46:4350'git difftool' can be customized to run an alternative program
Junio C Hamano3bd66e92009-04-18 06:17:5651by specifying the command line to invoke in a configuration
52variable `difftool.<tool>.cmd`.
53+
Junio C Hamano1aa40d22010-01-21 17:46:4354When 'git difftool' is invoked with this tool (either through the
Junio C Hamano3bd66e92009-04-18 06:17:5655`-t` or `--tool` option or the `diff.tool` configuration variable)
56the configured command line will be invoked with the following
57variables available: `$LOCAL` is set to the name of the temporary
58file containing the contents of the diff pre-image and `$REMOTE`
59is set to the name of the temporary file containing the contents
Junio C Hamano0d75e872010-12-17 06:57:2660of the diff post-image. `$MERGED` is the name of the file which is
61being compared. `$BASE` is provided for compatibility
62with custom merge tool commands and has the same value as `$MERGED`.
Junio C Hamano3bd66e92009-04-18 06:17:5663
Junio C Hamanoa9701f02010-01-21 00:42:1664-x <command>::
65--extcmd=<command>::
66Specify a custom command for viewing diffs.
67'git-difftool' ignores the configured defaults and runs
68`$command $LOCAL $REMOTE` when this option is specified.
Junio C Hamano0d75e872010-12-17 06:57:2669Additionally, `$BASE` is set in the environment.
Junio C Hamanoa9701f02010-01-21 00:42:1670
71-g::
72--gui::
73When 'git-difftool' is invoked with the `-g` or `--gui` option
74the default diff tool will be read from the configured
75`diff.guitool` variable instead of `diff.tool`.
76
Junio C Hamano3bd66e92009-04-18 06:17:5677See linkgit:git-diff[1] for the full list of supported options.
78
79CONFIG VARIABLES
80----------------
Junio C Hamano1aa40d22010-01-21 17:46:4381'git difftool' falls back to 'git mergetool' config variables when the
Junio C Hamano3bd66e92009-04-18 06:17:5682difftool equivalents have not been defined.
83
84diff.tool::
85The default diff tool to use.
86
Junio C Hamanoa9701f02010-01-21 00:42:1687diff.guitool::
88The default diff tool to use when `--gui` is specified.
89
Junio C Hamano3bd66e92009-04-18 06:17:5690difftool.<tool>.path::
91Override the path for the given tool. This is useful in case
92your tool is not in the PATH.
93
94difftool.<tool>.cmd::
95Specify the command to invoke the specified diff tool.
96+
97See the `--tool=<tool>` option above for more details.
98
99difftool.prompt::
100Prompt before each invocation of the diff tool.
101
102SEE ALSO
103--------
104linkgit:git-diff[1]::
105 Show changes between commits, commit and working tree, etc
106
107linkgit:git-mergetool[1]::
108Run merge conflict resolution tools to resolve merge conflicts
109
110linkgit:git-config[1]::
111 Get and set repository or global options
112
Junio C Hamano3bd66e92009-04-18 06:17:56113GIT
114---
115Part of the linkgit:git[1] suite