Merge branch 'maint-1.6.1' into maint-1.6.2
[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>] [-y|--no-prompt|--prompt] [<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 'git-merge'.
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 <tool>::
26 --tool=<tool>::
27         Use the merge resolution program specified by <tool>.
28         Valid merge tools are:
29         kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff
30 +
31 If a merge resolution program is not specified, 'git-mergetool'
32 will use the configuration variable `merge.tool`.  If the
33 configuration variable `merge.tool` is not set, 'git-mergetool'
34 will pick a suitable default.
35 +
36 You can explicitly provide a full path to the tool by setting the
37 configuration variable `mergetool.<tool>.path`. For example, you
38 can configure the absolute path to kdiff3 by setting
39 `mergetool.kdiff3.path`. Otherwise, 'git-mergetool' assumes the
40 tool is available in PATH.
41 +
42 Instead of running one of the known merge tool programs,
43 'git-mergetool' can be customized to run an alternative program
44 by specifying the command line to invoke in a configuration
45 variable `mergetool.<tool>.cmd`.
46 +
47 When 'git-mergetool' is invoked with this tool (either through the
48 `-t` or `--tool` option or the `merge.tool` configuration
49 variable) the configured command line will be invoked with `$BASE`
50 set to the name of a temporary file containing the common base for
51 the merge, if available; `$LOCAL` set to the name of a temporary
52 file containing the contents of the file on the current branch;
53 `$REMOTE` set to the name of a temporary file containing the
54 contents of the file to be merged, and `$MERGED` set to the name
55 of the file to which the merge tool should write the result of the
56 merge resolution.
57 +
58 If the custom merge tool correctly indicates the success of a
59 merge resolution with its exit code, then the configuration
60 variable `mergetool.<tool>.trustExitCode` can be set to `true`.
61 Otherwise, 'git-mergetool' will prompt the user to indicate the
62 success of the resolution after the custom tool has exited.
63
64 -y::
65 --no-prompt::
66         Don't prompt before each invocation of the merge resolution
67         program.
68
69 --prompt::
70         Prompt before each invocation of the merge resolution program.
71         This is the default behaviour; the option is provided to
72         override any configuration settings.
73
74 Author
75 ------
76 Written by Theodore Y Ts'o <tytso@mit.edu>
77
78 Documentation
79 --------------
80 Documentation by Theodore Y Ts'o.
81
82 GIT
83 ---
84 Part of the linkgit:git[1] suite