.\" Copyright (c) 1990 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)diff3.1 6.3 (Berkeley) %G%
.Nd 3-way differential file comparison
utility compares the contents of three different versions of a file,
writing the result to the standard output.
The options describe different methods of merging and
the separate versions into a new file.
to merge specific versions or create
Produces output in a form suitable as an input script for the
utility. The script may then be used to merge differences common
between all three files and differences specific to file1 and file3.
option ignores differences specific to file1 and file2, and those
specific to file2 and file3. It is useful for backing out changes
Produces an output script suitable for
specific only to all three versions.
Produces an output script suitable for
respectively, but treat overlapping changes (i.e., changes that would
be noted with ==== in the normal listing) differently. The overlapping
lines from both files will be inserted by the edit script, bracketed
by "<<<<<<" and ">>>>>>" lines.
to insure that overlapping changes in the merged files are preserved
and brought to someone's attention.
For example, suppose lines 7-8 are changed in both file1 and file2.
Applying the edit script generated by the command
.Dl diff3 -E file1 file2 file3
to file1 results in the file:
makes notation of the differences between all files, and those differences
specific to each pair of files. The
the commands neccessary for
to create the desired target from the different versions.
for a description of the commands.
The lines beneath this notation are ranges of lines which are different
The lines beneath this notation are ranges of lines which are exclusively
If three files were to contain:
.Cw mooxthree mooxthree mooxthree
.Cl moo three moo moo moo moo
.Dl diff3 -e file1 file2 file3
produces the following ed script:
appeared in Version 7 AT&T Unix.
as the first ans only character on the line.
The resulting script will fail on that line