]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-difftool.txt
Merge branch 'ef/help-cmd-prefix'
[thirdparty/git.git] / Documentation / git-difftool.txt
CommitLineData
5c38ea31
DA
1git-difftool(1)
2===============
3
4NAME
5----
8b733222 6git-difftool - Show changes using common diff tools
5c38ea31
DA
7
8SYNOPSIS
9--------
9edb8a0f 10'git difftool' [<options>] [<commit> [<commit>]] [--] [<path>...]
5c38ea31
DA
11
12DESCRIPTION
13-----------
0b444cdb 14'git difftool' is a git command that allows you to compare and edit files
8b733222 15between revisions using common diff tools. 'git difftool' is a frontend
49bd56a5
JK
16to 'git diff' and accepts the same options and arguments. See
17linkgit:git-diff[1].
5c38ea31
DA
18
19OPTIONS
20-------
8b733222
DA
21-y::
22--no-prompt::
23 Do not prompt before launching a diff tool.
24
a904392e
DA
25--prompt::
26 Prompt before each invocation of the diff tool.
27 This is the default behaviour; the option is provided to
28 override any configuration settings.
29
5c38ea31
DA
30-t <tool>::
31--tool=<tool>::
8b733222 32 Use the diff tool specified by <tool>.
5c38ea31 33 Valid merge tools are:
1c0f3d22 34 kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
c8998b48 35 ecmerge, diffuse, opendiff, p4merge and araxis.
5c38ea31 36+
0b444cdb 37If a diff tool is not specified, 'git difftool'
2464456a 38will use the configuration variable `diff.tool`. If the
0b444cdb 39configuration variable `diff.tool` is not set, 'git difftool'
5c38ea31
DA
40will pick a suitable default.
41+
42You can explicitly provide a full path to the tool by setting the
2464456a 43configuration variable `difftool.<tool>.path`. For example, you
5c38ea31 44can configure the absolute path to kdiff3 by setting
0b444cdb 45`difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the
5c38ea31
DA
46tool is available in PATH.
47+
8b733222 48Instead of running one of the known diff tools,
0b444cdb 49'git difftool' can be customized to run an alternative program
5c38ea31 50by specifying the command line to invoke in a configuration
2464456a 51variable `difftool.<tool>.cmd`.
5c38ea31 52+
0b444cdb 53When 'git difftool' is invoked with this tool (either through the
2464456a 54`-t` or `--tool` option or the `diff.tool` configuration variable)
5c38ea31
DA
55the configured command line will be invoked with the following
56variables available: `$LOCAL` is set to the name of the temporary
57file containing the contents of the diff pre-image and `$REMOTE`
58is set to the name of the temporary file containing the contents
59of the diff post-image. `$BASE` is provided for compatibility
60with custom merge tool commands and has the same value as `$LOCAL`.
61
f47f1e2c 62-x <command>::
1c6f5b52
DA
63--extcmd=<command>::
64 Specify a custom command for viewing diffs.
65 'git-difftool' ignores the configured defaults and runs
66 `$command $LOCAL $REMOTE` when this option is specified.
67
4cefa495
DA
68-g::
69--gui::
70 When 'git-difftool' is invoked with the `-g` or `--gui` option
71 the default diff tool will be read from the configured
72 `diff.guitool` variable instead of `diff.tool`.
73
8b733222 74See linkgit:git-diff[1] for the full list of supported options.
5c38ea31
DA
75
76CONFIG VARIABLES
77----------------
0b444cdb 78'git difftool' falls back to 'git mergetool' config variables when the
2464456a 79difftool equivalents have not been defined.
5c38ea31 80
2464456a 81diff.tool::
8b733222 82 The default diff tool to use.
5c38ea31 83
4cefa495
DA
84diff.guitool::
85 The default diff tool to use when `--gui` is specified.
86
2464456a 87difftool.<tool>.path::
5c38ea31
DA
88 Override the path for the given tool. This is useful in case
89 your tool is not in the PATH.
90
2464456a 91difftool.<tool>.cmd::
8b733222 92 Specify the command to invoke the specified diff tool.
5c38ea31
DA
93+
94See the `--tool=<tool>` option above for more details.
95
a904392e
DA
96difftool.prompt::
97 Prompt before each invocation of the diff tool.
98
5c38ea31
DA
99SEE ALSO
100--------
507cfcbd 101linkgit:git-diff[1]::
5c38ea31
DA
102 Show changes between commits, commit and working tree, etc
103
104linkgit:git-mergetool[1]::
105 Run merge conflict resolution tools to resolve merge conflicts
106
507cfcbd 107linkgit:git-config[1]::
5c38ea31
DA
108 Get and set repository or global options
109
110
111AUTHOR
112------
113Written by David Aguilar <davvid@gmail.com>.
114
115Documentation
116--------------
117Documentation by David Aguilar and the git-list <git@vger.kernel.org>.
118
119GIT
120---
121Part of the linkgit:git[1] suite