6 git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
11 'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>...]
16 Use `git mergetool` to run one of several merge utilities to resolve
17 merge conflicts. It is typically run after 'git merge'.
19 If one or more <file> parameters are given, the merge tool program will
20 be run to resolve differences on each file. If no <file> names are
21 specified, 'git mergetool' will run the merge tool program on every file
28 Use the merge resolution program specified by <tool>.
29 Valid merge tools are:
30 araxis, bc3, diffuse, ecmerge, emerge, gvimdiff, kdiff3,
31 meld, opendiff, p4merge, tkdiff, tortoisemerge, vimdiff and xxdiff.
33 If a merge resolution program is not specified, 'git mergetool'
34 will use the configuration variable `merge.tool`. If the
35 configuration variable `merge.tool` is not set, 'git mergetool'
36 will pick a suitable default.
38 You can explicitly provide a full path to the tool by setting the
39 configuration variable `mergetool.<tool>.path`. For example, you
40 can configure the absolute path to kdiff3 by setting
41 `mergetool.kdiff3.path`. Otherwise, 'git mergetool' assumes the
42 tool is available in PATH.
44 Instead of running one of the known merge tool programs,
45 'git mergetool' can be customized to run an alternative program
46 by specifying the command line to invoke in a configuration
47 variable `mergetool.<tool>.cmd`.
49 When 'git mergetool' is invoked with this tool (either through the
50 `-t` or `--tool` option or the `merge.tool` configuration
51 variable) the configured command line will be invoked with `$BASE`
52 set to the name of a temporary file containing the common base for
53 the merge, if available; `$LOCAL` set to the name of a temporary
54 file containing the contents of the file on the current branch;
55 `$REMOTE` set to the name of a temporary file containing the
56 contents of the file to be merged, and `$MERGED` set to the name
57 of the file to which the merge tool should write the result of the
60 If the custom merge tool correctly indicates the success of a
61 merge resolution with its exit code, then the configuration
62 variable `mergetool.<tool>.trustExitCode` can be set to `true`.
63 Otherwise, 'git mergetool' will prompt the user to indicate the
64 success of the resolution after the custom tool has exited.
68 Don't prompt before each invocation of the merge resolution
72 Prompt before each invocation of the merge resolution program.
73 This is the default behaviour; the option is provided to
74 override any configuration settings.
78 `git mergetool` creates `*.orig` backup files while resolving merges.
79 These are safe to remove once a file has been merged and its
80 `git mergetool` session has completed.
82 Setting the `mergetool.keepBackup` configuration variable to `false`
83 causes `git mergetool` to automatically remove the backup as files
84 are successfully merged.
88 Part of the linkgit:git[1] suite