]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-merge-file.txt
manpages: italicize gitk's name (where it was in teletype font)
[thirdparty/git.git] / Documentation / git-merge-file.txt
CommitLineData
9abaa7f0 1git-merge-file(1)
38477d9e 2=================
9abaa7f0
JS
3
4NAME
5----
c3f0baac 6git-merge-file - Run a three-way file merge
9abaa7f0
JS
7
8
9SYNOPSIS
10--------
11[verse]
b1889c36 12'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
9abaa7f0
JS
13 [-p|--stdout] [-q|--quiet] <current-file> <base-file> <other-file>
14
15
16DESCRIPTION
17-----------
ba020ef5 18'git-file-merge' incorporates all changes that lead from the `<base-file>`
9abaa7f0 19to `<other-file>` into `<current-file>`. The result ordinarily goes into
ba020ef5 20`<current-file>`. 'git-merge-file' is useful for combining separate changes
9abaa7f0
JS
21to an original. Suppose `<base-file>` is the original, and both
22`<current-file>` and `<other-file>` are modifications of `<base-file>`.
ba020ef5 23Then 'git-merge-file' combines both changes.
9abaa7f0
JS
24
25A conflict occurs if both `<current-file>` and `<other-file>` have changes
ba020ef5 26in a common segment of lines. If a conflict is found, 'git-merge-file'
9abaa7f0
JS
27normally outputs a warning and brackets the conflict with <<<<<<< and
28>>>>>>> lines. A typical conflict will look like this:
29
30 <<<<<<< A
31 lines in file A
32 =======
33 lines 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
ba020ef5 42'git-merge-file' is designed to be a minimal clone of RCS `merge`; that is, it
9abaa7f0 43implements all of RCS merge's functionality which is needed by
5162e697 44linkgit:git[1].
9abaa7f0
JS
45
46
47OPTIONS
48-------
49
50-L <label>::
51 This option may be given up to three times, and
52 specifies labels to be used in place of the
53 corresponding file names in conflict reports. That is,
b1889c36 54 `git merge-file -L x -L y -L z a b c` generates output that
9abaa7f0
JS
55 looks like it came from files x, y and z instead of
56 from files a, b and c.
57
58-p::
59 Send results to standard output instead of overwriting
60 `<current-file>`.
61
62-q::
63 Quiet; do not warn about conflicts.
64
65
66EXAMPLES
67--------
68
69git merge-file README.my README README.upstream::
70
71 combines the changes of README.my and README.upstream since README,
72 tries 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
76 merges 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>,
0979c106 88with parts copied from the original documentation of RCS 'merge'.
9abaa7f0
JS
89
90GIT
91---
9e1f0a85 92Part of the linkgit:git[1] suite