Documentation / git-mergetool.txton commit Merge branch 'ss/wt-status-committable' (929e85a)
   1git-mergetool(1)
   2================
   3
   4NAME
   5----
   6git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
   7
   8SYNOPSIS
   9--------
  10[verse]
  11'git mergetool' [--tool=<tool>] [-y | --[no-]prompt] [<file>...]
  12
  13DESCRIPTION
  14-----------
  15
  16Use `git mergetool` to run one of several merge utilities to resolve
  17merge conflicts.  It is typically run after 'git merge'.
  18
  19If one or more <file> parameters are given, the merge tool program will
  20be run to resolve differences on each file (skipping those without
  21conflicts).  Specifying a directory will include all unresolved files in
  22that path.  If no <file> names are specified, 'git mergetool' will run
  23the merge tool program on every file with merge conflicts.
  24
  25OPTIONS
  26-------
  27-t <tool>::
  28--tool=<tool>::
  29        Use the merge resolution program specified by <tool>.
  30        Valid values include emerge, gvimdiff, kdiff3,
  31        meld, vimdiff, and tortoisemerge. Run `git mergetool --tool-help`
  32        for the list of valid <tool> settings.
  33+
  34If a merge resolution program is not specified, 'git mergetool'
  35will use the configuration variable `merge.tool`.  If the
  36configuration variable `merge.tool` is not set, 'git mergetool'
  37will pick a suitable default.
  38+
  39You can explicitly provide a full path to the tool by setting the
  40configuration variable `mergetool.<tool>.path`. For example, you
  41can configure the absolute path to kdiff3 by setting
  42`mergetool.kdiff3.path`. Otherwise, 'git mergetool' assumes the
  43tool is available in PATH.
  44+
  45Instead of running one of the known merge tool programs,
  46'git mergetool' can be customized to run an alternative program
  47by specifying the command line to invoke in a configuration
  48variable `mergetool.<tool>.cmd`.
  49+
  50When 'git mergetool' is invoked with this tool (either through the
  51`-t` or `--tool` option or the `merge.tool` configuration
  52variable) the configured command line will be invoked with `$BASE`
  53set to the name of a temporary file containing the common base for
  54the merge, if available; `$LOCAL` set to the name of a temporary
  55file containing the contents of the file on the current branch;
  56`$REMOTE` set to the name of a temporary file containing the
  57contents of the file to be merged, and `$MERGED` set to the name
  58of the file to which the merge tool should write the result of the
  59merge resolution.
  60+
  61If the custom merge tool correctly indicates the success of a
  62merge resolution with its exit code, then the configuration
  63variable `mergetool.<tool>.trustExitCode` can be set to `true`.
  64Otherwise, 'git mergetool' will prompt the user to indicate the
  65success of the resolution after the custom tool has exited.
  66
  67--tool-help::
  68        Print a list of merge tools that may be used with `--tool`.
  69
  70-y::
  71--no-prompt::
  72        Don't prompt before each invocation of the merge resolution
  73        program.
  74        This is the default if the merge resolution program is
  75        explicitly specified with the `--tool` option or with the
  76        `merge.tool` configuration variable.
  77
  78--prompt::
  79        Prompt before each invocation of the merge resolution program
  80        to give the user a chance to skip the path.
  81
  82-O<orderfile>::
  83        Process files in the order specified in the
  84        <orderfile>, which has one shell glob pattern per line.
  85        This overrides the `diff.orderFile` configuration variable
  86        (see linkgit:git-config[1]).  To cancel `diff.orderFile`,
  87        use `-O/dev/null`.
  88
  89TEMPORARY FILES
  90---------------
  91`git mergetool` creates `*.orig` backup files while resolving merges.
  92These are safe to remove once a file has been merged and its
  93`git mergetool` session has completed.
  94
  95Setting the `mergetool.keepBackup` configuration variable to `false`
  96causes `git mergetool` to automatically remove the backup as files
  97are successfully merged.
  98
  99GIT
 100---
 101Part of the linkgit:git[1] suite