t3412: clean up GIT_EDITOR usage
[git/git.git] / contrib / difftool / git-difftool.txt
CommitLineData
5c38ea31
DA
1git-difftool(1)
2===============
3
4NAME
5----
6git-difftool - compare changes using common merge tools
7
8SYNOPSIS
9--------
10'git difftool' [--tool=<tool>] [--no-prompt] ['git diff' options]
11
12DESCRIPTION
13-----------
507cfcbd 14'git-difftool' is a git command that allows you to compare and edit files
5c38ea31 15between revisions using common merge tools. At its most basic level,
507cfcbd 16'git-difftool' does what 'git-mergetool' does but its use is for non-merge
5c38ea31
DA
17situations such as when preparing commits or comparing changes against
18the index.
19
20'git difftool' is a frontend to 'git diff' and accepts the same
21arguments and options.
22
507cfcbd 23See linkgit:git-diff[1] for the full list of supported options.
5c38ea31
DA
24
25OPTIONS
26-------
27-t <tool>::
28--tool=<tool>::
29 Use the merge resolution program specified by <tool>.
30 Valid merge tools are:
31 kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff
32+
507cfcbd 33If a merge resolution program is not specified, 'git-difftool'
5c38ea31
DA
34will use the configuration variable `merge.tool`. If the
35configuration variable `merge.tool` is not set, 'git difftool'
36will pick a suitable default.
37+
38You can explicitly provide a full path to the tool by setting the
39configuration variable `mergetool.<tool>.path`. For example, you
40can configure the absolute path to kdiff3 by setting
507cfcbd 41`mergetool.kdiff3.path`. Otherwise, 'git-difftool' assumes the
5c38ea31
DA
42tool is available in PATH.
43+
44Instead of running one of the known merge tool programs,
507cfcbd 45'git-difftool' can be customized to run an alternative program
5c38ea31
DA
46by specifying the command line to invoke in a configuration
47variable `mergetool.<tool>.cmd`.
48+
507cfcbd 49When 'git-difftool' is invoked with this tool (either through the
5c38ea31
DA
50`-t` or `--tool` option or the `merge.tool` configuration variable)
51the configured command line will be invoked with the following
52variables available: `$LOCAL` is set to the name of the temporary
53file containing the contents of the diff pre-image and `$REMOTE`
54is set to the name of the temporary file containing the contents
55of the diff post-image. `$BASE` is provided for compatibility
56with custom merge tool commands and has the same value as `$LOCAL`.
57
58--no-prompt::
507cfcbd 59 Do not prompt before launching a diff tool.
5c38ea31
DA
60
61CONFIG VARIABLES
62----------------
63merge.tool::
64 The default merge tool to use.
65+
66See the `--tool=<tool>` option above for more details.
67
68merge.keepBackup::
69 The original, unedited file content can be saved to a file with
70 a `.orig` extension. Defaults to `true` (i.e. keep the backup files).
71
72mergetool.<tool>.path::
73 Override the path for the given tool. This is useful in case
74 your tool is not in the PATH.
75
76mergetool.<tool>.cmd::
77 Specify the command to invoke the specified merge tool.
78+
79See the `--tool=<tool>` option above for more details.
80
81
82SEE ALSO
83--------
507cfcbd 84linkgit:git-diff[1]::
5c38ea31
DA
85 Show changes between commits, commit and working tree, etc
86
87linkgit:git-mergetool[1]::
88 Run merge conflict resolution tools to resolve merge conflicts
89
507cfcbd 90linkgit:git-config[1]::
5c38ea31
DA
91 Get and set repository or global options
92
93
94AUTHOR
95------
96Written by David Aguilar <davvid@gmail.com>.
97
98Documentation
99--------------
100Documentation by David Aguilar and the git-list <git@vger.kernel.org>.
101
102GIT
103---
104Part of the linkgit:git[1] suite