]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-mergetool.txt
Documentation: be consistent about "git-" versus "git "
[thirdparty/git.git] / Documentation / git-mergetool.txt
CommitLineData
c4b4a5af
TT
1git-mergetool(1)
2================
3
4NAME
5----
6git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
7
8SYNOPSIS
9--------
b1889c36 10'git mergetool' [--tool=<tool>] [<file>]...
c4b4a5af
TT
11
12DESCRIPTION
13-----------
14
bbdfbc4b 15Use `git mergetool` to run one of several merge utilities to resolve
5162e697 16merge conflicts. It is typically run after linkgit:git-merge[1].
c4b4a5af
TT
17
18If one or more <file> parameters are given, the merge tool program will
19be run to resolve differences on each file. If no <file> names are
b1889c36 20specified, `git-mergetool` will run the merge tool program on every file
c4b4a5af
TT
21with merge conflicts.
22
23OPTIONS
24-------
25-t or --tool=<tool>::
26 Use the merge resolution program specified by <tool>.
27 Valid merge tools are:
ca8e6b7a 28 kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff
e15b484f 29+
b1889c36 30If a merge resolution program is not specified, `git-mergetool`
bbdfbc4b 31will use the configuration variable `merge.tool`. If the
b1889c36 32configuration variable `merge.tool` is not set, `git-mergetool`
e15b484f 33will pick a suitable default.
e3fa2c76
SP
34+
35You can explicitly provide a full path to the tool by setting the
bbdfbc4b 36configuration variable `mergetool.<tool>.path`. For example, you
e3fa2c76 37can configure the absolute path to kdiff3 by setting
b1889c36 38`mergetool.kdiff3.path`. Otherwise, `git-mergetool` assumes the
bbdfbc4b 39tool is available in PATH.
caa99829
CB
40+
41Instead of running one of the known merge tool programs
b1889c36 42`git-mergetool` can be customized to run an alternative program
caa99829
CB
43by specifying the command line to invoke in a configration
44variable `mergetool.<tool>.cmd`.
45+
b1889c36 46When `git-mergetool` is invoked with this tool (either through the
caa99829
CB
47`-t` or `--tool` option or the `merge.tool` configuration
48variable) the configured command line will be invoked with `$BASE`
49set to the name of a temporary file containing the common base for
50the merge, if available; `$LOCAL` set to the name of a temporary
51file containing the contents of the file on the current branch;
52`$REMOTE` set to the name of a temporary file containing the
53contents of the file to be merged, and `$MERGED` set to the name
54of the file to which the merge tool should write the result of the
55merge resolution.
56+
57If the custom merge tool correctly indicates the success of a
58merge resolution with its exit code then the configuration
59variable `mergetool.<tool>.trustExitCode` can be set to `true`.
b1889c36 60Otherwise, `git-mergetool` will prompt the user to indicate the
caa99829 61success of the resolution after the custom tool has exited.
c4b4a5af
TT
62
63Author
64------
65Written by Theodore Y Ts'o <tytso@mit.edu>
66
67Documentation
68--------------
69Documentation by Theodore Y Ts'o.
70
71GIT
72---
9e1f0a85 73Part of the linkgit:git[1] suite