LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

merge

performs three-way file merge

TLDR

Three-way merge
$ merge [file] [base] [other]
copy
Output to different file
$ merge -p [file] [base] [other] > [merged]
copy
Quiet mode
$ merge -q [file] [base] [other]
copy
Show conflict markers using diff3 style
$ merge -A [file] [base] [other]
copy
Merge with custom labels for conflict markers
$ merge -L [mine] -L [base] -L [theirs] [file] [base] [other]
copy

SYNOPSIS

merge [options] file1 file2 file3

DESCRIPTION

merge performs three-way file merge. It incorporates changes from file3 (relative to file2) into file1. The common ancestor file2 is used to determine which changes were made in each version.The tool is part of the RCS (Revision Control System) suite. When conflicts occur, merge writes conflict markers into file1 for manual resolution. The exit status is 0 for no conflicts, 1 if conflicts were found, or 2 for trouble.

PARAMETERS

FILE1

File to receive changes.
FILE2
Common ancestor file.
FILE3
File with changes.
-p
Print to stdout.
-q
Quiet mode.
-A
Output conflicts using diff3 -A style (most verbose).
-E
Output conflicts using diff3 -E style (default).
-e
Like -E, but does not warn about conflicts.
-L LABEL
Use label instead of filename in conflict markers. May be given up to three times.
-V
Print RCS version number.

CAVEATS

Part of RCS. Conflicts need manual resolution. Exit code indicates conflicts.

HISTORY

merge is part of RCS (Revision Control System), providing three-way file merging capability.

SEE ALSO

diff3(1), diff(1), patch(1), rcs(1), sdiff(1), git-merge(1)

Copied to clipboard
Kai