6 git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
10 'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...
15 Use `git mergetool` to run one of several merge utilities to resolve
16 merge conflicts. It is typically run after 'git merge'.
18 If one or more <file> parameters are given, the merge tool program will
19 be run to resolve differences on each file. If no <file> names are
20 specified, 'git mergetool' will run the merge tool program on every file
27 Use the merge resolution program specified by <tool>.
28 Valid merge tools are:
29 kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,
30 diffuse, tortoisemerge, opendiff, p4merge and araxis.
32 If a merge resolution program is not specified, 'git mergetool'
33 will use the configuration variable `merge.tool`. If the
34 configuration variable `merge.tool` is not set, 'git mergetool'
35 will pick a suitable default.
37 You can explicitly provide a full path to the tool by setting the
38 configuration variable `mergetool.<tool>.path`. For example, you
39 can configure the absolute path to kdiff3 by setting
40 `mergetool.kdiff3.path`. Otherwise, 'git mergetool' assumes the
41 tool is available in PATH.
43 Instead of running one of the known merge tool programs,
44 'git mergetool' can be customized to run an alternative program
45 by specifying the command line to invoke in a configuration
46 variable `mergetool.<tool>.cmd`.
48 When 'git mergetool' is invoked with this tool (either through the
49 `-t` or `--tool` option or the `merge.tool` configuration
50 variable) the configured command line will be invoked with `$BASE`
51 set to the name of a temporary file containing the common base for
52 the merge, if available; `$LOCAL` set to the name of a temporary
53 file containing the contents of the file on the current branch;
54 `$REMOTE` set to the name of a temporary file containing the
55 contents of the file to be merged, and `$MERGED` set to the name
56 of the file to which the merge tool should write the result of the
59 If the custom merge tool correctly indicates the success of a
60 merge resolution with its exit code, then the configuration
61 variable `mergetool.<tool>.trustExitCode` can be set to `true`.
62 Otherwise, 'git mergetool' will prompt the user to indicate the
63 success of the resolution after the custom tool has exited.
67 Don't prompt before each invocation of the merge resolution
71 Prompt before each invocation of the merge resolution program.
72 This is the default behaviour; the option is provided to
73 override any configuration settings.
77 Written by Theodore Y Ts'o <tytso@mit.edu>
81 Documentation by Theodore Y Ts'o.
85 Part of the linkgit:git[1] suite