Add more default aliases
[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 [verse]
11 'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]
12
13 ALIAS
14 ~~~~~
15 'git mt'
16
17 DESCRIPTION
18 -----------
19
20 Use `git mergetool` to run one of several merge utilities to resolve
21 merge conflicts.  It is typically run after 'git merge'.
22
23 If one or more <file> parameters are given, the merge tool program will
24 be run to resolve differences on each file (skipping those without
25 conflicts).  Specifying a directory will include all unresolved files in
26 that path.  If no <file> names are specified, 'git mergetool' will run
27 the merge tool program on every file with merge conflicts.
28
29 OPTIONS
30 -------
31 -t <tool>::
32 --tool=<tool>::
33         Use the merge resolution program specified by <tool>.
34         Valid values include emerge, gvimdiff, kdiff3,
35         meld, vimdiff, and tortoisemerge. Run `git mergetool --tool-help`
36         for the list of valid <tool> settings.
37 +
38 If a merge resolution program is not specified, 'git mergetool'
39 will use the configuration variable `merge.tool`.  If the
40 configuration variable `merge.tool` is not set, 'git mergetool'
41 will pick a suitable default.
42 +
43 You can explicitly provide a full path to the tool by setting the
44 configuration variable `mergetool.<tool>.path`. For example, you
45 can configure the absolute path to kdiff3 by setting
46 `mergetool.kdiff3.path`. Otherwise, 'git mergetool' assumes the
47 tool is available in PATH.
48 +
49 Instead of running one of the known merge tool programs,
50 'git mergetool' can be customized to run an alternative program
51 by specifying the command line to invoke in a configuration
52 variable `mergetool.<tool>.cmd`.
53 +
54 When 'git mergetool' is invoked with this tool (either through the
55 `-t` or `--tool` option or the `merge.tool` configuration
56 variable) the configured command line will be invoked with `$BASE`
57 set to the name of a temporary file containing the common base for
58 the merge, if available; `$LOCAL` set to the name of a temporary
59 file containing the contents of the file on the current branch;
60 `$REMOTE` set to the name of a temporary file containing the
61 contents of the file to be merged, and `$MERGED` set to the name
62 of the file to which the merge tool should write the result of the
63 merge resolution.
64 +
65 If the custom merge tool correctly indicates the success of a
66 merge resolution with its exit code, then the configuration
67 variable `mergetool.<tool>.trustExitCode` can be set to `true`.
68 Otherwise, 'git mergetool' will prompt the user to indicate the
69 success of the resolution after the custom tool has exited.
70
71 --tool-help::
72         Print a list of merge tools that may be used with `--tool`.
73
74 -y::
75 --no-prompt::
76         Don't prompt before each invocation of the merge resolution
77         program.
78         This is the default if the merge resolution program is
79         explicitly specified with the `--tool` option or with the
80         `merge.tool` configuration variable.
81
82 --prompt::
83         Prompt before each invocation of the merge resolution program
84         to give the user a chance to skip the path.
85
86 TEMPORARY FILES
87 ---------------
88 `git mergetool` creates `*.orig` backup files while resolving merges.
89 These are safe to remove once a file has been merged and its
90 `git mergetool` session has completed.
91
92 Setting the `mergetool.keepBackup` configuration variable to `false`
93 causes `git mergetool` to automatically remove the backup as files
94 are successfully merged.
95
96 GIT
97 ---
98 Part of the linkgit:git[1] suite