blob: 31fc2e3aed613acd8cb6e4a56ae66c378fb07a0d [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-------
Junio C Hamanobcdb12e2012-05-10 18:45:1522-d::
23--dir-diff::
24Copy the modified files to a temporary location and perform
25a directory diff on them. This mode never prompts before
26launching the diff tool.
27
Junio C Hamano3bd66e92009-04-18 06:17:5628-y::
29--no-prompt::
30Do not prompt before launching a diff tool.
31
32--prompt::
33Prompt before each invocation of the diff tool.
34This is the default behaviour; the option is provided to
35override any configuration settings.
36
37-t <tool>::
38--tool=<tool>::
Junio C Hamanobcdb12e2012-05-10 18:45:1539Use the diff tool specified by <tool>. Valid values include
40emerge, kompare, meld, and vimdiff. Run `git difftool --tool-help`
41for the list of valid <tool> settings.
Junio C Hamano3bd66e92009-04-18 06:17:5642+
Junio C Hamano1aa40d22010-01-21 17:46:4343If a diff tool is not specified, 'git difftool'
Junio C Hamano3bd66e92009-04-18 06:17:5644will use the configuration variable `diff.tool`. If the
Junio C Hamano1aa40d22010-01-21 17:46:4345configuration variable `diff.tool` is not set, 'git difftool'
Junio C Hamano3bd66e92009-04-18 06:17:5646will pick a suitable default.
47+
48You can explicitly provide a full path to the tool by setting the
49configuration variable `difftool.<tool>.path`. For example, you
50can configure the absolute path to kdiff3 by setting
Junio C Hamano1aa40d22010-01-21 17:46:4351`difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the
Junio C Hamano3bd66e92009-04-18 06:17:5652tool is available in PATH.
53+
54Instead of running one of the known diff tools,
Junio C Hamano1aa40d22010-01-21 17:46:4355'git difftool' can be customized to run an alternative program
Junio C Hamano3bd66e92009-04-18 06:17:5656by specifying the command line to invoke in a configuration
57variable `difftool.<tool>.cmd`.
58+
Junio C Hamano1aa40d22010-01-21 17:46:4359When 'git difftool' is invoked with this tool (either through the
Junio C Hamano3bd66e92009-04-18 06:17:5660`-t` or `--tool` option or the `diff.tool` configuration variable)
61the configured command line will be invoked with the following
62variables available: `$LOCAL` is set to the name of the temporary
63file containing the contents of the diff pre-image and `$REMOTE`
64is set to the name of the temporary file containing the contents
Junio C Hamano0d75e872010-12-17 06:57:2665of the diff post-image. `$MERGED` is the name of the file which is
66being compared. `$BASE` is provided for compatibility
67with custom merge tool commands and has the same value as `$MERGED`.
Junio C Hamano3bd66e92009-04-18 06:17:5668
Junio C Hamanobcdb12e2012-05-10 18:45:1569--tool-help::
70Print a list of diff tools that may be used with `--tool`.
71
Junio C Hamanoa9701f02010-01-21 00:42:1672-x <command>::
73--extcmd=<command>::
74Specify a custom command for viewing diffs.
75'git-difftool' ignores the configured defaults and runs
76`$command $LOCAL $REMOTE` when this option is specified.
Junio C Hamano0d75e872010-12-17 06:57:2677Additionally, `$BASE` is set in the environment.
Junio C Hamanoa9701f02010-01-21 00:42:1678
79-g::
80--gui::
81When 'git-difftool' is invoked with the `-g` or `--gui` option
82the default diff tool will be read from the configured
83`diff.guitool` variable instead of `diff.tool`.
84
Junio C Hamano3bd66e92009-04-18 06:17:5685See linkgit:git-diff[1] for the full list of supported options.
86
87CONFIG VARIABLES
88----------------
Junio C Hamano1aa40d22010-01-21 17:46:4389'git difftool' falls back to 'git mergetool' config variables when the
Junio C Hamano3bd66e92009-04-18 06:17:5690difftool equivalents have not been defined.
91
92diff.tool::
93The default diff tool to use.
94
Junio C Hamanoa9701f02010-01-21 00:42:1695diff.guitool::
96The default diff tool to use when `--gui` is specified.
97
Junio C Hamano3bd66e92009-04-18 06:17:5698difftool.<tool>.path::
99Override the path for the given tool. This is useful in case
100your tool is not in the PATH.
101
102difftool.<tool>.cmd::
103Specify the command to invoke the specified diff tool.
104+
105See the `--tool=<tool>` option above for more details.
106
107difftool.prompt::
108Prompt before each invocation of the diff tool.
109
110SEE ALSO
111--------
112linkgit:git-diff[1]::
113 Show changes between commits, commit and working tree, etc
114
115linkgit:git-mergetool[1]::
116Run merge conflict resolution tools to resolve merge conflicts
117
118linkgit:git-config[1]::
119 Get and set repository or global options
120
Junio C Hamano3bd66e92009-04-18 06:17:56121GIT
122---
123Part of the linkgit:git[1] suite