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