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