]>
Commit | Line | Data |
---|---|---|
c4b4a5af TT |
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 | -------- | |
0adda936 | 10 | 'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>...] |
c4b4a5af TT |
11 | |
12 | DESCRIPTION | |
13 | ----------- | |
14 | ||
bbdfbc4b | 15 | Use `git mergetool` to run one of several merge utilities to resolve |
0b444cdb | 16 | merge conflicts. It is typically run after 'git merge'. |
c4b4a5af TT |
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 | |
0b444cdb | 20 | specified, 'git mergetool' will run the merge tool program on every file |
c4b4a5af TT |
21 | with merge conflicts. |
22 | ||
23 | OPTIONS | |
24 | ------- | |
6b89d068 MH |
25 | -t <tool>:: |
26 | --tool=<tool>:: | |
c4b4a5af TT |
27 | Use the merge resolution program specified by <tool>. |
28 | Valid merge tools are: | |
ffe6dc08 | 29 | araxis, bc3, diffuse, ecmerge, emerge, gvimdiff, kdiff3, |
aa03f604 | 30 | meld, opendiff, p4merge, tkdiff, tortoisemerge, vimdiff and xxdiff. |
e15b484f | 31 | + |
0b444cdb | 32 | If a merge resolution program is not specified, 'git mergetool' |
bbdfbc4b | 33 | will use the configuration variable `merge.tool`. If the |
0b444cdb | 34 | configuration variable `merge.tool` is not set, 'git mergetool' |
e15b484f | 35 | will pick a suitable default. |
e3fa2c76 SP |
36 | + |
37 | You can explicitly provide a full path to the tool by setting the | |
bbdfbc4b | 38 | configuration variable `mergetool.<tool>.path`. For example, you |
e3fa2c76 | 39 | can configure the absolute path to kdiff3 by setting |
0b444cdb | 40 | `mergetool.kdiff3.path`. Otherwise, 'git mergetool' assumes the |
bbdfbc4b | 41 | tool is available in PATH. |
caa99829 | 42 | + |
29b802aa | 43 | Instead of running one of the known merge tool programs, |
0b444cdb | 44 | 'git mergetool' can be customized to run an alternative program |
1168d402 | 45 | by specifying the command line to invoke in a configuration |
caa99829 CB |
46 | variable `mergetool.<tool>.cmd`. |
47 | + | |
0b444cdb | 48 | When 'git mergetool' is invoked with this tool (either through the |
caa99829 CB |
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 | |
29b802aa | 60 | merge resolution with its exit code, then the configuration |
caa99829 | 61 | variable `mergetool.<tool>.trustExitCode` can be set to `true`. |
0b444cdb | 62 | Otherwise, 'git mergetool' will prompt the user to indicate the |
caa99829 | 63 | success of the resolution after the custom tool has exited. |
c4b4a5af | 64 | |
6b89d068 MH |
65 | -y:: |
66 | --no-prompt:: | |
682b451f CB |
67 | Don't prompt before each invocation of the merge resolution |
68 | program. | |
69 | ||
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. | |
74 | ||
d1cc4621 DA |
75 | TEMPORARY FILES |
76 | --------------- | |
77 | `git mergetool` creates `*.orig` backup files while resolving merges. | |
78 | These are safe to remove once a file has been merged and its | |
79 | `git mergetool` session has completed. | |
80 | ||
81 | Setting the `mergetool.keepBackup` configuration variable to `false` | |
82 | causes `git mergetool` to automatically remove the backup as files | |
83 | are successfully merged. | |
84 | ||
c4b4a5af TT |
85 | GIT |
86 | --- | |
9e1f0a85 | 87 | Part of the linkgit:git[1] suite |