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