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