2009-01-16 16:00:02 +08:00
|
|
|
git-difftool(1)
|
|
|
|
===============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2009-04-07 16:21:19 +08:00
|
|
|
git-difftool - Show changes using common diff tools
|
2009-01-16 16:00:02 +08:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2011-07-02 10:38:26 +08:00
|
|
|
[verse]
|
2010-11-05 01:18:17 +08:00
|
|
|
'git difftool' [<options>] [<commit> [<commit>]] [--] [<path>...]
|
2009-01-16 16:00:02 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2013-01-22 03:17:53 +08:00
|
|
|
'git difftool' is a Git command that allows you to compare and edit files
|
2009-04-07 16:21:19 +08:00
|
|
|
between revisions using common diff tools. 'git difftool' is a frontend
|
2010-11-05 05:17:29 +08:00
|
|
|
to 'git diff' and accepts the same options and arguments. See
|
|
|
|
linkgit:git-diff[1].
|
2009-01-16 16:00:02 +08:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2012-04-24 02:23:41 +08:00
|
|
|
-d::
|
|
|
|
--dir-diff::
|
|
|
|
Copy the modified files to a temporary location and perform
|
|
|
|
a directory diff on them. This mode never prompts before
|
|
|
|
launching the diff tool.
|
|
|
|
|
2009-04-07 16:21:19 +08:00
|
|
|
-y::
|
|
|
|
--no-prompt::
|
|
|
|
Do not prompt before launching a diff tool.
|
|
|
|
|
2009-04-07 16:21:22 +08:00
|
|
|
--prompt::
|
|
|
|
Prompt before each invocation of the diff tool.
|
|
|
|
This is the default behaviour; the option is provided to
|
|
|
|
override any configuration settings.
|
|
|
|
|
2009-01-16 16:00:02 +08:00
|
|
|
-t <tool>::
|
|
|
|
--tool=<tool>::
|
2012-03-29 21:39:18 +08:00
|
|
|
Use the diff tool specified by <tool>. Valid values include
|
|
|
|
emerge, kompare, meld, and vimdiff. Run `git difftool --tool-help`
|
|
|
|
for the list of valid <tool> settings.
|
2009-01-16 16:00:02 +08:00
|
|
|
+
|
2010-01-10 07:33:00 +08:00
|
|
|
If a diff tool is not specified, 'git difftool'
|
2009-03-09 17:12:36 +08:00
|
|
|
will use the configuration variable `diff.tool`. If the
|
2010-01-10 07:33:00 +08:00
|
|
|
configuration variable `diff.tool` is not set, 'git difftool'
|
2009-01-16 16:00:02 +08:00
|
|
|
will pick a suitable default.
|
|
|
|
+
|
|
|
|
You can explicitly provide a full path to the tool by setting the
|
2009-03-09 17:12:36 +08:00
|
|
|
configuration variable `difftool.<tool>.path`. For example, you
|
2009-01-16 16:00:02 +08:00
|
|
|
can configure the absolute path to kdiff3 by setting
|
2010-01-10 07:33:00 +08:00
|
|
|
`difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the
|
2009-01-16 16:00:02 +08:00
|
|
|
tool is available in PATH.
|
|
|
|
+
|
2009-04-07 16:21:19 +08:00
|
|
|
Instead of running one of the known diff tools,
|
2010-01-10 07:33:00 +08:00
|
|
|
'git difftool' can be customized to run an alternative program
|
2009-01-16 16:00:02 +08:00
|
|
|
by specifying the command line to invoke in a configuration
|
2009-03-09 17:12:36 +08:00
|
|
|
variable `difftool.<tool>.cmd`.
|
2009-01-16 16:00:02 +08:00
|
|
|
+
|
2010-01-10 07:33:00 +08:00
|
|
|
When 'git difftool' is invoked with this tool (either through the
|
2009-03-09 17:12:36 +08:00
|
|
|
`-t` or `--tool` option or the `diff.tool` configuration variable)
|
2009-01-16 16:00:02 +08:00
|
|
|
the configured command line will be invoked with the following
|
|
|
|
variables available: `$LOCAL` is set to the name of the temporary
|
|
|
|
file containing the contents of the diff pre-image and `$REMOTE`
|
|
|
|
is set to the name of the temporary file containing the contents
|
2010-12-14 17:18:34 +08:00
|
|
|
of the diff post-image. `$MERGED` is the name of the file which is
|
|
|
|
being compared. `$BASE` is provided for compatibility
|
|
|
|
with custom merge tool commands and has the same value as `$MERGED`.
|
2009-01-16 16:00:02 +08:00
|
|
|
|
2012-08-10 15:39:22 +08:00
|
|
|
--tool-help::
|
|
|
|
Print a list of diff tools that may be used with `--tool`.
|
|
|
|
|
2013-05-09 09:16:55 +08:00
|
|
|
--[no-]symlinks::
|
2012-07-23 14:05:30 +08:00
|
|
|
'git difftool''s default behavior is create symlinks to the
|
2013-03-15 04:19:41 +08:00
|
|
|
working tree when run in `--dir-diff` mode and the right-hand
|
|
|
|
side of the comparison yields the same content as the file in
|
|
|
|
the working tree.
|
2012-07-23 14:05:30 +08:00
|
|
|
+
|
2013-03-15 04:19:39 +08:00
|
|
|
Specifying `--no-symlinks` instructs 'git difftool' to create copies
|
|
|
|
instead. `--no-symlinks` is the default on Windows.
|
2012-07-23 14:05:30 +08:00
|
|
|
|
2010-01-16 06:03:43 +08:00
|
|
|
-x <command>::
|
2010-01-10 12:02:42 +08:00
|
|
|
--extcmd=<command>::
|
|
|
|
Specify a custom command for viewing diffs.
|
|
|
|
'git-difftool' ignores the configured defaults and runs
|
|
|
|
`$command $LOCAL $REMOTE` when this option is specified.
|
2010-12-14 17:18:35 +08:00
|
|
|
Additionally, `$BASE` is set in the environment.
|
2010-01-10 12:02:42 +08:00
|
|
|
|
2009-12-23 13:27:14 +08:00
|
|
|
-g::
|
2017-02-07 14:32:07 +08:00
|
|
|
--[no-]gui::
|
2009-12-23 13:27:14 +08:00
|
|
|
When 'git-difftool' is invoked with the `-g` or `--gui` option
|
|
|
|
the default diff tool will be read from the configured
|
2017-02-07 14:32:07 +08:00
|
|
|
`diff.guitool` variable instead of `diff.tool`. The `--no-gui`
|
|
|
|
option can be used to override this setting.
|
2009-12-23 13:27:14 +08:00
|
|
|
|
2014-10-27 09:15:42 +08:00
|
|
|
--[no-]trust-exit-code::
|
|
|
|
'git-difftool' invokes a diff tool individually on each file.
|
|
|
|
Errors reported by the diff tool are ignored by default.
|
|
|
|
Use `--trust-exit-code` to make 'git-difftool' exit when an
|
|
|
|
invoked diff tool returns a non-zero exit code.
|
|
|
|
+
|
|
|
|
'git-difftool' will forward the exit code of the invoked tool when
|
2016-06-28 19:40:11 +08:00
|
|
|
`--trust-exit-code` is used.
|
2014-10-27 09:15:42 +08:00
|
|
|
|
2009-04-07 16:21:19 +08:00
|
|
|
See linkgit:git-diff[1] for the full list of supported options.
|
2009-01-16 16:00:02 +08:00
|
|
|
|
|
|
|
CONFIG VARIABLES
|
|
|
|
----------------
|
2010-01-10 07:33:00 +08:00
|
|
|
'git difftool' falls back to 'git mergetool' config variables when the
|
2009-03-09 17:12:36 +08:00
|
|
|
difftool equivalents have not been defined.
|
2009-01-16 16:00:02 +08:00
|
|
|
|
2009-03-09 17:12:36 +08:00
|
|
|
diff.tool::
|
2009-04-07 16:21:19 +08:00
|
|
|
The default diff tool to use.
|
2009-01-16 16:00:02 +08:00
|
|
|
|
2009-12-23 13:27:14 +08:00
|
|
|
diff.guitool::
|
|
|
|
The default diff tool to use when `--gui` is specified.
|
|
|
|
|
2009-03-09 17:12:36 +08:00
|
|
|
difftool.<tool>.path::
|
2009-01-16 16:00:02 +08:00
|
|
|
Override the path for the given tool. This is useful in case
|
|
|
|
your tool is not in the PATH.
|
|
|
|
|
2009-03-09 17:12:36 +08:00
|
|
|
difftool.<tool>.cmd::
|
2009-04-07 16:21:19 +08:00
|
|
|
Specify the command to invoke the specified diff tool.
|
2009-01-16 16:00:02 +08:00
|
|
|
+
|
|
|
|
See the `--tool=<tool>` option above for more details.
|
|
|
|
|
2009-04-07 16:21:22 +08:00
|
|
|
difftool.prompt::
|
|
|
|
Prompt before each invocation of the diff tool.
|
|
|
|
|
2014-10-27 09:15:42 +08:00
|
|
|
difftool.trustExitCode::
|
|
|
|
Exit difftool if the invoked diff tool returns a non-zero exit status.
|
|
|
|
+
|
|
|
|
See the `--trust-exit-code` option above for more details.
|
|
|
|
|
2009-01-16 16:00:02 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
2009-01-19 13:27:19 +08:00
|
|
|
linkgit:git-diff[1]::
|
2009-01-16 16:00:02 +08:00
|
|
|
Show changes between commits, commit and working tree, etc
|
|
|
|
|
|
|
|
linkgit:git-mergetool[1]::
|
|
|
|
Run merge conflict resolution tools to resolve merge conflicts
|
|
|
|
|
2009-01-19 13:27:19 +08:00
|
|
|
linkgit:git-config[1]::
|
2009-01-16 16:00:02 +08:00
|
|
|
Get and set repository or global options
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
|
|
|
Part of the linkgit:git[1] suite
|