blob: e0b2703b380cb46b23870a97b861462d8e8f758a [file] [log] [blame]
Junio C Hamano103ad7f2007-03-14 11:19:261git-mergetool(1)
2================
3
4NAME
5----
6git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
7
8SYNOPSIS
9--------
Junio C Hamanofce7c7e2008-07-02 03:06:3810'git mergetool' [--tool=<tool>] [<file>]...
Junio C Hamano103ad7f2007-03-14 11:19:2611
12DESCRIPTION
13-----------
14
Junio C Hamanobb343172008-03-09 10:39:0915Use `git mergetool` to run one of several merge utilities to resolve
Junio C Hamanoba4b9282008-07-06 05:20:3116merge conflicts. It is typically run after 'git-merge'.
Junio C Hamano103ad7f2007-03-14 11:19:2617
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
Junio C Hamanoba4b9282008-07-06 05:20:3120specified, 'git-mergetool' will run the merge tool program on every file
Junio C Hamano103ad7f2007-03-14 11:19:2621with merge conflicts.
22
23OPTIONS
24-------
25-t or --tool=<tool>::
26Use the merge resolution program specified by <tool>.
27Valid merge tools are:
Junio C Hamano1c708832007-11-02 02:47:5028kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff
Junio C Hamano3aa81822007-03-30 08:52:2629+
Junio C Hamanoba4b9282008-07-06 05:20:3130If a merge resolution program is not specified, 'git-mergetool'
Junio C Hamanobb343172008-03-09 10:39:0931will use the configuration variable `merge.tool`. If the
Junio C Hamanoba4b9282008-07-06 05:20:3132configuration variable `merge.tool` is not set, 'git-mergetool'
Junio C Hamano3aa81822007-03-30 08:52:2633will pick a suitable default.
Junio C Hamano1c708832007-11-02 02:47:5034+
35You can explicitly provide a full path to the tool by setting the
Junio C Hamanobb343172008-03-09 10:39:0936configuration variable `mergetool.<tool>.path`. For example, you
Junio C Hamano1c708832007-11-02 02:47:5037can configure the absolute path to kdiff3 by setting
Junio C Hamanoba4b9282008-07-06 05:20:3138`mergetool.kdiff3.path`. Otherwise, 'git-mergetool' assumes the
Junio C Hamanobb343172008-03-09 10:39:0939tool is available in PATH.
40+
41Instead of running one of the known merge tool programs
Junio C Hamanoba4b9282008-07-06 05:20:3142'git-mergetool' can be customized to run an alternative program
Junio C Hamanocb1c44f2008-08-06 06:19:3343by specifying the command line to invoke in a configuration
Junio C Hamanobb343172008-03-09 10:39:0944variable `mergetool.<tool>.cmd`.
45+
Junio C Hamanoba4b9282008-07-06 05:20:3146When 'git-mergetool' is invoked with this tool (either through the
Junio C Hamanobb343172008-03-09 10:39:0947`-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`.
Junio C Hamanoba4b9282008-07-06 05:20:3160Otherwise, 'git-mergetool' will prompt the user to indicate the
Junio C Hamanobb343172008-03-09 10:39:0961success of the resolution after the custom tool has exited.
Junio C Hamano103ad7f2007-03-14 11:19:2662
63Author
64------
65Written by Theodore Y Ts'o <tytso@mit.edu>
66
67Documentation
68--------------
69Documentation by Theodore Y Ts'o.
70
71GIT
72---
Junio C Hamanof7c042d2008-06-06 22:50:5373Part of the linkgit:git[1] suite