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