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