1GIT-MERGE-FILE(1)                 Git Manual                 GIT-MERGE-FILE(1)
2
3
4

NAME

6       git-merge-file - Run a three-way file merge
7

SYNOPSIS

9       git merge-file [-L <current-name> [-L <base-name> [-L <other-name>]]]
10               [--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
11               <current-file> <base-file> <other-file>
12
13

DESCRIPTION

15       git merge-file incorporates all changes that lead from the <base-file>
16       to <other-file> into <current-file>. The result ordinarily goes into
17       <current-file>. git merge-file is useful for combining separate changes
18       to an original. Suppose <base-file> is the original, and both
19       <current-file> and <other-file> are modifications of <base-file>, then
20       git merge-file combines both changes.
21
22       A conflict occurs if both <current-file> and <other-file> have changes
23       in a common segment of lines. If a conflict is found, git merge-file
24       normally outputs a warning and brackets the conflict with lines
25       containing <<<<<<< and >>>>>>> markers. A typical conflict will look
26       like this:
27
28           <<<<<<< A
29           lines in file A
30           =======
31           lines in file B
32           >>>>>>> B
33
34       If there are conflicts, the user should edit the result and delete one
35       of the alternatives. When --ours, --theirs, or --union option is in
36       effect, however, these conflicts are resolved favouring lines from
37       <current-file>, lines from <other-file>, or lines from both
38       respectively. The length of the conflict markers can be given with the
39       --marker-size option.
40
41       The exit value of this program is negative on error, and the number of
42       conflicts otherwise. If the merge was clean, the exit value is 0.
43
44       git merge-file is designed to be a minimal clone of RCS merge; that is,
45       it implements all of RCS merge's functionality which is needed by
46       git(1).
47

OPTIONS

49       -L <label>
50           This option may be given up to three times, and specifies labels to
51           be used in place of the corresponding file names in conflict
52           reports. That is, git merge-file -L x -L y -L z a b c generates
53           output that looks like it came from files x, y and z instead of
54           from files a, b and c.
55
56       -p
57           Send results to standard output instead of overwriting
58           <current-file>.
59
60       -q
61           Quiet; do not warn about conflicts.
62
63       --ours, --theirs, --union
64           Instead of leaving conflicts in the file, resolve conflicts
65           favouring our (or their or both) side of the lines.
66

EXAMPLES

68       git merge-file README.my README README.upstream
69           combines the changes of README.my and README.upstream since README,
70           tries to merge them and writes the result into README.my.
71
72       git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345
73           merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses
74           labels a and c instead of tmp/a123 and tmp/c345.
75

GIT

77       Part of the git(1) suite
78
79
80
81Git 1.8.3.1                       11/19/2018                 GIT-MERGE-FILE(1)
Impressum