submodule: Use cat instead of echo to avoid DOS line-endings
[git/dscho.git] / Documentation / git-mergetool.txt
blob347091010995af95e43ced744b159b277bdb6cdc
1 git-mergetool(1)
2 ================
4 NAME
5 ----
6 git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
8 SYNOPSIS
9 --------
10 [verse]
11 'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>...]
13 DESCRIPTION
14 -----------
16 Use `git mergetool` to run one of several merge utilities to resolve
17 merge conflicts.  It is typically run after 'git merge'.
19 If one or more <file> parameters are given, the merge tool program will
20 be run to resolve differences on each file.  If no <file> names are
21 specified, 'git mergetool' will run the merge tool program on every file
22 with merge conflicts.
24 OPTIONS
25 -------
26 -t <tool>::
27 --tool=<tool>::
28         Use the merge resolution program specified by <tool>.
29         Valid merge tools are:
30         araxis, bc3, diffuse, ecmerge, emerge, gvimdiff, kdiff3,
31         meld, opendiff, p4merge, tkdiff, tortoisemerge, vimdiff and xxdiff.
33 If a merge resolution program is not specified, 'git mergetool'
34 will use the configuration variable `merge.tool`.  If the
35 configuration variable `merge.tool` is not set, 'git mergetool'
36 will pick a suitable default.
38 You can explicitly provide a full path to the tool by setting the
39 configuration variable `mergetool.<tool>.path`. For example, you
40 can configure the absolute path to kdiff3 by setting
41 `mergetool.kdiff3.path`. Otherwise, 'git mergetool' assumes the
42 tool is available in PATH.
44 Instead of running one of the known merge tool programs,
45 'git mergetool' can be customized to run an alternative program
46 by specifying the command line to invoke in a configuration
47 variable `mergetool.<tool>.cmd`.
49 When 'git mergetool' is invoked with this tool (either through the
50 `-t` or `--tool` option or the `merge.tool` configuration
51 variable) the configured command line will be invoked with `$BASE`
52 set to the name of a temporary file containing the common base for
53 the merge, if available; `$LOCAL` set to the name of a temporary
54 file containing the contents of the file on the current branch;
55 `$REMOTE` set to the name of a temporary file containing the
56 contents of the file to be merged, and `$MERGED` set to the name
57 of the file to which the merge tool should write the result of the
58 merge resolution.
60 If the custom merge tool correctly indicates the success of a
61 merge resolution with its exit code, then the configuration
62 variable `mergetool.<tool>.trustExitCode` can be set to `true`.
63 Otherwise, 'git mergetool' will prompt the user to indicate the
64 success of the resolution after the custom tool has exited.
66 -y::
67 --no-prompt::
68         Don't prompt before each invocation of the merge resolution
69         program.
71 --prompt::
72         Prompt before each invocation of the merge resolution program.
73         This is the default behaviour; the option is provided to
74         override any configuration settings.
76 TEMPORARY FILES
77 ---------------
78 `git mergetool` creates `*.orig` backup files while resolving merges.
79 These are safe to remove once a file has been merged and its
80 `git mergetool` session has completed.
82 Setting the `mergetool.keepBackup` configuration variable to `false`
83 causes `git mergetool` to automatically remove the backup as files
84 are successfully merged.
86 GIT
87 ---
88 Part of the linkgit:git[1] suite