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