]>
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 | -------- | |
b1889c36 | 10 | 'git mergetool' [--tool=<tool>] [<file>]... |
c4b4a5af TT |
11 | |
12 | DESCRIPTION | |
13 | ----------- | |
14 | ||
bbdfbc4b | 15 | Use `git mergetool` to run one of several merge utilities to resolve |
ba020ef5 | 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 | |
ba020ef5 | 20 | specified, 'git-mergetool' will run the merge tool program on every file |
c4b4a5af TT |
21 | with merge conflicts. |
22 | ||
23 | OPTIONS | |
24 | ------- | |
25 | -t or --tool=<tool>:: | |
26 | Use the merge resolution program specified by <tool>. | |
27 | Valid merge tools are: | |
ca8e6b7a | 28 | kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff |
e15b484f | 29 | + |
ba020ef5 | 30 | If a merge resolution program is not specified, 'git-mergetool' |
bbdfbc4b | 31 | will use the configuration variable `merge.tool`. If the |
ba020ef5 | 32 | configuration variable `merge.tool` is not set, 'git-mergetool' |
e15b484f | 33 | will pick a suitable default. |
e3fa2c76 SP |
34 | + |
35 | You can explicitly provide a full path to the tool by setting the | |
bbdfbc4b | 36 | configuration variable `mergetool.<tool>.path`. For example, you |
e3fa2c76 | 37 | can configure the absolute path to kdiff3 by setting |
ba020ef5 | 38 | `mergetool.kdiff3.path`. Otherwise, 'git-mergetool' assumes the |
bbdfbc4b | 39 | tool is available in PATH. |
caa99829 | 40 | + |
29b802aa | 41 | Instead of running one of the known merge tool programs, |
ba020ef5 | 42 | 'git-mergetool' can be customized to run an alternative program |
1168d402 | 43 | by specifying the command line to invoke in a configuration |
caa99829 CB |
44 | variable `mergetool.<tool>.cmd`. |
45 | + | |
ba020ef5 | 46 | When 'git-mergetool' is invoked with this tool (either through the |
caa99829 CB |
47 | `-t` or `--tool` option or the `merge.tool` configuration |
48 | variable) the configured command line will be invoked with `$BASE` | |
49 | set to the name of a temporary file containing the common base for | |
50 | the merge, if available; `$LOCAL` set to the name of a temporary | |
51 | file containing the contents of the file on the current branch; | |
52 | `$REMOTE` set to the name of a temporary file containing the | |
53 | contents of the file to be merged, and `$MERGED` set to the name | |
54 | of the file to which the merge tool should write the result of the | |
55 | merge resolution. | |
56 | + | |
57 | If the custom merge tool correctly indicates the success of a | |
29b802aa | 58 | merge resolution with its exit code, then the configuration |
caa99829 | 59 | variable `mergetool.<tool>.trustExitCode` can be set to `true`. |
ba020ef5 | 60 | Otherwise, 'git-mergetool' will prompt the user to indicate the |
caa99829 | 61 | success of the resolution after the custom tool has exited. |
c4b4a5af TT |
62 | |
63 | Author | |
64 | ------ | |
65 | Written by Theodore Y Ts'o <tytso@mit.edu> | |
66 | ||
67 | Documentation | |
68 | -------------- | |
69 | Documentation by Theodore Y Ts'o. | |
70 | ||
71 | GIT | |
72 | --- | |
9e1f0a85 | 73 | Part of the linkgit:git[1] suite |