Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 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 | -------- |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 10 | 'git mergetool' [--tool=<tool>] [<file>]... |
Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 11 | |
| 12 | DESCRIPTION |
| 13 | ----------- |
| 14 | |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 15 | Use `git mergetool` to run one of several merge utilities to resolve |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 16 | merge conflicts. It is typically run after 'git-merge'. |
Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 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 |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 20 | specified, 'git-mergetool' will run the merge tool program on every file |
Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 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: |
Junio C Hamano | 1c70883 | 2007-11-02 02:47:50 | [diff] [blame] | 28 | kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff |
Junio C Hamano | 3aa8182 | 2007-03-30 08:52:26 | [diff] [blame] | 29 | + |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 30 | If a merge resolution program is not specified, 'git-mergetool' |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 31 | will use the configuration variable `merge.tool`. If the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 32 | configuration variable `merge.tool` is not set, 'git-mergetool' |
Junio C Hamano | 3aa8182 | 2007-03-30 08:52:26 | [diff] [blame] | 33 | will pick a suitable default. |
Junio C Hamano | 1c70883 | 2007-11-02 02:47:50 | [diff] [blame] | 34 | + |
| 35 | You can explicitly provide a full path to the tool by setting the |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 36 | configuration variable `mergetool.<tool>.path`. For example, you |
Junio C Hamano | 1c70883 | 2007-11-02 02:47:50 | [diff] [blame] | 37 | can configure the absolute path to kdiff3 by setting |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 38 | `mergetool.kdiff3.path`. Otherwise, 'git-mergetool' assumes the |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 39 | tool is available in PATH. |
| 40 | + |
| 41 | Instead of running one of the known merge tool programs |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 42 | 'git-mergetool' can be customized to run an alternative program |
Junio C Hamano | cb1c44f | 2008-08-06 06:19:33 | [diff] [blame] | 43 | by specifying the command line to invoke in a configuration |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 44 | variable `mergetool.<tool>.cmd`. |
| 45 | + |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 46 | When 'git-mergetool' is invoked with this tool (either through the |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 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 |
| 58 | merge resolution with its exit code then the configuration |
| 59 | variable `mergetool.<tool>.trustExitCode` can be set to `true`. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 60 | Otherwise, 'git-mergetool' will prompt the user to indicate the |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 61 | success of the resolution after the custom tool has exited. |
Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 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 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 73 | Part of the linkgit:git[1] suite |