Code

ff9700d17a333f50d6509bc14a0bd81fad876d3b
[git.git] / Documentation / git-mergetool.txt
1 git-mergetool(1)
2 ================
4 NAME
5 ----
6 git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
8 SYNOPSIS
9 --------
10 'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...
12 DESCRIPTION
13 -----------
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
21 with merge conflicts.
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,
30         diffuse, tortoisemerge and opendiff
31 +
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.
36 +
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.
42 +
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`.
47 +
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
57 merge resolution.
58 +
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.
65 -y::
66 --no-prompt::
67         Don't prompt before each invocation of the merge resolution
68         program.
70 --prompt::
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.
75 Author
76 ------
77 Written by Theodore Y Ts'o <tytso@mit.edu>
79 Documentation
80 --------------
81 Documentation by Theodore Y Ts'o.
83 GIT
84 ---
85 Part of the linkgit:git[1] suite