merge(1)merge(1)NAMEmerge - three-way file mergeSYNOPSIS
file1 file2 file3
DESCRIPTION
combines two files that are revisions of a single original file. The
original file is file2, and the revised files are file1 and file3.
identifies all changes that lead from file2 to file3 and from file2 to
file1, then deposits the merged text into file1. If the option is
used, the result goes to standard output instead of file1.
An overlap occurs if both file1 and file3 have changes in the same
place. prints how many overlaps occurred, and includes both alterna‐
tives in the result. The alternatives are delimited as follows:
lines in file1
lines in file3
If there are overlaps, edit the result in file1 and delete one of the
alternatives.
This command is particularly useful for revision control, especially if
file1 and file3 are the ends of two branches that have file2 as a com‐
mon ancestor.
EXAMPLES
A typical use for is as follows:
1. To merge an RCS branch into the trunk, first check out the
three different versions from RCS (see co(1)) and rename
them for their revision numbers: 5.2, 5.11, and 5.2.3.3.
File 5.2.3.3 is the end of an RCS branch that split off the
trunk at file 5.2.
2. For this example, assume file 5.11 is the latest version on
the trunk, and is also a revision of the "original" file,
5.2. Merge the branch into the trunk with the command:
3. File 5.11 now contains all changes made on the branch and
the trunk, and has markings in the file to show all over‐
lapping changes.
4. Edit file 5.11 to correct the overlaps, then use the com‐
mand to check the file back in (see ci(1)).
WARNINGS
uses the ed(1) system editor. Therefore, the file size limits of ed(1)
apply to
AUTHOR
was developed by Walter F. Tichy.
SEE ALSOdiff3(1), diff(1), rcsmerge(1), co(1).
merge(1)