1GIT-MERGE-FILE(1) Git Manual GIT-MERGE-FILE(1)
2
3
4
6 git-merge-file - Run a three-way file merge
7
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 [--[no-]diff3] <current-file> <base-file> <other-file>
12
13
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 (truncated to 127 if there are more than that many
43 conflicts). 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,
46 it implements all of RCS merge's functionality which is needed by
47 git(1).
48
50 -L <label>
51 This option may be given up to three times, and specifies labels to
52 be used in place of the corresponding file names in conflict
53 reports. That is, git merge-file -L x -L y -L z a b c generates
54 output that looks like it came from files x, y and z instead of
55 from files a, b and c.
56
57 -p
58 Send results to standard output instead of overwriting
59 <current-file>.
60
61 -q
62 Quiet; do not warn about conflicts.
63
64 --diff3
65 Show conflicts in "diff3" style.
66
67 --ours, --theirs, --union
68 Instead of leaving conflicts in the file, resolve conflicts
69 favouring our (or their or both) side of the lines.
70
72 git merge-file README.my README README.upstream
73 combines the changes of README.my and README.upstream since README,
74 tries to merge them and writes the result into README.my.
75
76 git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345
77 merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses
78 labels a and c instead of tmp/a123 and tmp/c345.
79
81 Part of the git(1) suite
82
83
84
85Git 2.20.1 12/15/2018 GIT-MERGE-FILE(1)