blob: f057e49951188efa311997e4f79f1ccd480ed1b3 [file] [log] [blame]
Junio C Hamano1de7bc62006-12-17 19:31:541git-merge-file(1)
2=================
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-merge-file - Run a three-way file merge
Junio C Hamano1de7bc62006-12-17 19:31:547
8
9SYNOPSIS
10--------
11[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3812'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
Junio C Hamano1de7bc62006-12-17 19:31:5413[-p|--stdout] [-q|--quiet] <current-file> <base-file> <other-file>
14
15
16DESCRIPTION
17-----------
Junio C Hamanofce7c7e2008-07-02 03:06:3818`git-file-merge` incorporates all changes that lead from the `<base-file>`
Junio C Hamano1de7bc62006-12-17 19:31:5419to `<other-file>` into `<current-file>`. The result ordinarily goes into
Junio C Hamanofce7c7e2008-07-02 03:06:3820`<current-file>`. `git-merge-file` is useful for combining separate changes
Junio C Hamano1de7bc62006-12-17 19:31:5421to an original. Suppose `<base-file>` is the original, and both
22`<current-file>` and `<other-file>` are modifications of `<base-file>`.
Junio C Hamanofce7c7e2008-07-02 03:06:3823Then `git-merge-file` combines both changes.
Junio C Hamano1de7bc62006-12-17 19:31:5424
25A conflict occurs if both `<current-file>` and `<other-file>` have changes
Junio C Hamanofce7c7e2008-07-02 03:06:3826in a common segment of lines. If a conflict is found, `git-merge-file`
Junio C Hamano1de7bc62006-12-17 19:31:5427normally outputs a warning and brackets the conflict with <<<<<<< and
28>>>>>>> lines. A typical conflict will look like this:
29
30<<<<<<< A
31lines in file A
32=======
33lines in file B
34>>>>>>> B
35
36If there are conflicts, the user should edit the result and delete one of
37the alternatives.
38
39The exit value of this program is negative on error, and the number of
40conflicts otherwise. If the merge was clean, the exit value is 0.
41
Junio C Hamanofce7c7e2008-07-02 03:06:3842`git-merge-file` is designed to be a minimal clone of RCS `merge`; that is, it
Junio C Hamano1de7bc62006-12-17 19:31:5443implements all of RCS merge's functionality which is needed by
Junio C Hamano35738e82008-01-07 07:55:4644linkgit:git[1].
Junio C Hamano1de7bc62006-12-17 19:31:5445
46
47OPTIONS
48-------
49
50-L <label>::
51This option may be given up to three times, and
52specifies labels to be used in place of the
53corresponding file names in conflict reports. That is,
Junio C Hamanofce7c7e2008-07-02 03:06:3854`git merge-file -L x -L y -L z a b c` generates output that
Junio C Hamano1de7bc62006-12-17 19:31:5455looks like it came from files x, y and z instead of
56from files a, b and c.
57
58-p::
59Send results to standard output instead of overwriting
60`<current-file>`.
61
62-q::
63Quiet; do not warn about conflicts.
64
65
66EXAMPLES
67--------
68
69git merge-file README.my README README.upstream::
70
71combines the changes of README.my and README.upstream since README,
72tries to merge them and writes the result into README.my.
73
74git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345::
75
76merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels
77`a` and `c` instead of `tmp/a123` and `tmp/c345`.
78
79
80Author
81------
82Written by Johannes Schindelin <johannes.schindelin@gmx.de>
83
84
85Documentation
86--------------
87Documentation by Johannes Schindelin and the git-list <git@vger.kernel.org>,
88with parts copied from the original documentation of RCS merge.
89
90GIT
91---
Junio C Hamanof7c042d2008-06-06 22:50:5392Part of the linkgit:git[1] suite