]>
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 | -------- | |
7791a1d9 | 10 | [verse] |
9edb8a0f | 11 | 'git difftool' [<options>] [<commit> [<commit>]] [--] [<path>...] |
5c38ea31 DA |
12 | |
13 | DESCRIPTION | |
14 | ----------- | |
2de9b711 | 15 | 'git difftool' is a Git command that allows you to compare and edit files |
8b733222 | 16 | between revisions using common diff tools. 'git difftool' is a frontend |
49bd56a5 JK |
17 | to 'git diff' and accepts the same options and arguments. See |
18 | linkgit:git-diff[1]. | |
5c38ea31 DA |
19 | |
20 | OPTIONS | |
21 | ------- | |
7e0abcec TH |
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 | ||
8b733222 DA |
28 | -y:: |
29 | --no-prompt:: | |
30 | Do not prompt before launching a diff tool. | |
31 | ||
a904392e DA |
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 | ||
5c38ea31 DA |
37 | -t <tool>:: |
38 | --tool=<tool>:: | |
bf73fc21 TH |
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. | |
5c38ea31 | 42 | + |
0b444cdb | 43 | If a diff tool is not specified, 'git difftool' |
2464456a | 44 | will use the configuration variable `diff.tool`. If the |
0b444cdb | 45 | configuration variable `diff.tool` is not set, 'git difftool' |
5c38ea31 DA |
46 | will pick a suitable default. |
47 | + | |
48 | You can explicitly provide a full path to the tool by setting the | |
2464456a | 49 | configuration variable `difftool.<tool>.path`. For example, you |
5c38ea31 | 50 | can configure the absolute path to kdiff3 by setting |
0b444cdb | 51 | `difftool.kdiff3.path`. Otherwise, 'git difftool' assumes the |
5c38ea31 DA |
52 | tool is available in PATH. |
53 | + | |
8b733222 | 54 | Instead of running one of the known diff tools, |
0b444cdb | 55 | 'git difftool' can be customized to run an alternative program |
5c38ea31 | 56 | by specifying the command line to invoke in a configuration |
2464456a | 57 | variable `difftool.<tool>.cmd`. |
5c38ea31 | 58 | + |
0b444cdb | 59 | When 'git difftool' is invoked with this tool (either through the |
2464456a | 60 | `-t` or `--tool` option or the `diff.tool` configuration variable) |
5c38ea31 DA |
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 | |
51baceee MG |
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`. | |
5c38ea31 | 68 | |
7a30747f DA |
69 | --tool-help:: |
70 | Print a list of diff tools that may be used with `--tool`. | |
71 | ||
1f229345 DA |
72 | --symlinks:: |
73 | --no-symlinks:: | |
74 | 'git difftool''s default behavior is create symlinks to the | |
75 | working tree when run in `--dir-diff` mode. | |
76 | + | |
77 | Specifying `--no-symlinks` instructs 'git difftool' to create | |
78 | copies instead. `--no-symlinks` is the default on Windows. | |
79 | ||
f47f1e2c | 80 | -x <command>:: |
1c6f5b52 DA |
81 | --extcmd=<command>:: |
82 | Specify a custom command for viewing diffs. | |
83 | 'git-difftool' ignores the configured defaults and runs | |
84 | `$command $LOCAL $REMOTE` when this option is specified. | |
4a689afb | 85 | Additionally, `$BASE` is set in the environment. |
1c6f5b52 | 86 | |
4cefa495 DA |
87 | -g:: |
88 | --gui:: | |
89 | When 'git-difftool' is invoked with the `-g` or `--gui` option | |
90 | the default diff tool will be read from the configured | |
91 | `diff.guitool` variable instead of `diff.tool`. | |
92 | ||
8b733222 | 93 | See linkgit:git-diff[1] for the full list of supported options. |
5c38ea31 DA |
94 | |
95 | CONFIG VARIABLES | |
96 | ---------------- | |
0b444cdb | 97 | 'git difftool' falls back to 'git mergetool' config variables when the |
2464456a | 98 | difftool equivalents have not been defined. |
5c38ea31 | 99 | |
2464456a | 100 | diff.tool:: |
8b733222 | 101 | The default diff tool to use. |
5c38ea31 | 102 | |
4cefa495 DA |
103 | diff.guitool:: |
104 | The default diff tool to use when `--gui` is specified. | |
105 | ||
2464456a | 106 | difftool.<tool>.path:: |
5c38ea31 DA |
107 | Override the path for the given tool. This is useful in case |
108 | your tool is not in the PATH. | |
109 | ||
2464456a | 110 | difftool.<tool>.cmd:: |
8b733222 | 111 | Specify the command to invoke the specified diff tool. |
5c38ea31 DA |
112 | + |
113 | See the `--tool=<tool>` option above for more details. | |
114 | ||
a904392e DA |
115 | difftool.prompt:: |
116 | Prompt before each invocation of the diff tool. | |
117 | ||
5c38ea31 DA |
118 | SEE ALSO |
119 | -------- | |
507cfcbd | 120 | linkgit:git-diff[1]:: |
5c38ea31 DA |
121 | Show changes between commits, commit and working tree, etc |
122 | ||
123 | linkgit:git-mergetool[1]:: | |
124 | Run merge conflict resolution tools to resolve merge conflicts | |
125 | ||
507cfcbd | 126 | linkgit:git-config[1]:: |
5c38ea31 DA |
127 | Get and set repository or global options |
128 | ||
5c38ea31 DA |
129 | GIT |
130 | --- | |
131 | Part of the linkgit:git[1] suite |