Documentation / git-merge-file.txton commit Documentation: Describe other situations where -z affects git diff (03aa87e)
   1git-merge-file(1)
   2=================
   3
   4NAME
   5----
   6git-merge-file - Run a three-way file merge
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
  13        [--ours|--theirs] [-p|--stdout] [-q|--quiet]
  14        <current-file> <base-file> <other-file>
  15
  16
  17DESCRIPTION
  18-----------
  19'git merge-file' incorporates all changes that lead from the `<base-file>`
  20to `<other-file>` into `<current-file>`. The result ordinarily goes into
  21`<current-file>`. 'git merge-file' is useful for combining separate changes
  22to an original. Suppose `<base-file>` is the original, and both
  23`<current-file>` and `<other-file>` are modifications of `<base-file>`,
  24then 'git merge-file' combines both changes.
  25
  26A conflict occurs if both `<current-file>` and `<other-file>` have changes
  27in a common segment of lines. If a conflict is found, 'git merge-file'
  28normally outputs a warning and brackets the conflict with lines containing
  29<<<<<<< and >>>>>>> markers. A typical conflict will look like this:
  30
  31        <<<<<<< A
  32        lines in file A
  33        =======
  34        lines in file B
  35        >>>>>>> B
  36
  37If there are conflicts, the user should edit the result and delete one of
  38the alternatives.  When `--ours` or `--theirs` option is in effect, however,
  39these conflicts are resolved favouring lines from `<current-file>` or
  40lines from `<other-file>` respectively.
  41
  42The exit value of this program is negative on error, and the number of
  43conflicts otherwise. If the merge was clean, the exit value is 0.
  44
  45'git merge-file' is designed to be a minimal clone of RCS 'merge'; that is, it
  46implements all of RCS 'merge''s functionality which is needed by
  47linkgit:git[1].
  48
  49
  50OPTIONS
  51-------
  52
  53-L <label>::
  54        This option may be given up to three times, and
  55        specifies labels to be used in place of the
  56        corresponding file names in conflict reports. That is,
  57        `git merge-file -L x -L y -L z a b c` generates output that
  58        looks like it came from files x, y and z instead of
  59        from files a, b and c.
  60
  61-p::
  62        Send results to standard output instead of overwriting
  63        `<current-file>`.
  64
  65-q::
  66        Quiet; do not warn about conflicts.
  67
  68--ours::
  69--theirs::
  70        Instead of leaving conflicts in the file, resolve conflicts
  71        favouring our (or their) side of the lines.
  72
  73
  74EXAMPLES
  75--------
  76
  77git merge-file README.my README README.upstream::
  78
  79        combines the changes of README.my and README.upstream since README,
  80        tries to merge them and writes the result into README.my.
  81
  82git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345::
  83
  84        merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels
  85        `a` and `c` instead of `tmp/a123` and `tmp/c345`.
  86
  87
  88Author
  89------
  90Written by Johannes Schindelin <johannes.schindelin@gmx.de>
  91
  92
  93Documentation
  94--------------
  95Documentation by Johannes Schindelin and the git-list <git@vger.kernel.org>,
  96with parts copied from the original documentation of RCS 'merge'.
  97
  98GIT
  99---
 100Part of the linkgit:git[1] suite