merge.1 revision 11892
1.de Id
2.ds Rv \\$3
3.ds Dt \\$4
4..
5.Id $Id: merge.1,v 5.7 1995/06/01 16:23:43 eggert Exp $
6.TH MERGE 1 \*(Dt GNU
7.SH NAME
8merge \- three-way file merge
9.SH SYNOPSIS
10.B merge
11[
12.I "options"
13]
14.I "file1 file2 file3"
15.SH DESCRIPTION
16.B merge
17incorporates all changes that lead from
18.I file2
19to
20.I file3
21into
22.IR file1 .
23The result ordinarily goes into
24.IR file1 .
25.B merge
26is useful for combining separate changes to an original.  Suppose
27.I file2
28is the original, and both
29.I file1
30and
31.I file3
32are modifications of
33.IR file2 .
34Then
35.B merge
36combines both changes.
37.PP
38A conflict occurs if both
39.I file1
40and
41.I file3
42have changes in a common segment of lines.
43If a conflict is found,
44.B merge
45normally outputs a warning and brackets the conflict with
46.B <<<<<<<
47and
48.B >>>>>>>
49lines.
50A typical conflict will look like this:
51.LP
52.RS
53.nf
54.BI <<<<<<< " file A"
55.I "lines in file A"
56.B "======="
57.I "lines in file B"
58.BI >>>>>>> " file B"
59.RE
60.fi
61.LP
62If there are conflicts, the user should edit the result and delete one of the
63alternatives.
64.SH OPTIONS
65.TP
66.B \-A
67Output conflicts using the
68.B \-A
69style of
70.BR diff3 (1),
71if supported by
72.BR diff3 .
73This merges all changes leading from
74.I file2
75to
76.I file3
77into
78.IR file1 ,
79and generates the most verbose output.
80.TP
81\f3\-E\fP, \f3\-e\fP
82These options specify conflict styles that generate less information
83than
84.BR \-A .
85See
86.BR diff3 (1)
87for details.
88The default is
89.BR \-E .
90With
91.BR \-e ,
92.B merge
93does not warn about conflicts.
94.TP
95.BI \-L " label"
96This option may be given up to three times, and specifies labels
97to be used in place of the corresponding file names in conflict reports.
98That is,
99.B "merge\ \-L\ x\ \-L\ y\ \-L\ z\ a\ b\ c"
100generates output that looks like it came from files
101.BR x ,
102.B y
103and
104.B z
105instead of from files
106.BR a ,
107.B b
108and
109.BR c .
110.TP
111.BI \-p
112Send results to standard output instead of overwriting
113.IR file1 .
114.TP
115.BI \-q
116Quiet; do not warn about conflicts.
117.BI \-V
118Print \*r's version number.
119.SH DIAGNOSTICS
120Exit status is 0 for no conflicts, 1 for some conflicts, 2 for trouble.
121.SH IDENTIFICATION
122Author: Walter F. Tichy.
123.br
124Manual Page Revision: \*(Rv; Release Date: \*(Dt.
125.br
126Copyright \(co 1982, 1988, 1989 Walter F. Tichy.
127.br
128Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
129.SH SEE ALSO
130diff3(1), diff(1), rcsmerge(1), co(1).
131.SH BUGS
132It normally does not make sense to merge binary files as if they were text, but
133.B merge
134tries to do it anyway.
135.br
136