merge(1)

merge1

3-way file merge

Usage

merge [-EepqV] [-L label] file1 file2 file3

Overview

The merge program merges changes leading from file2 to file3 into file1.

The following options are supported:

-E

Default merge: see diff3(1) for details.

-e

Same as -E but does not warn about conflicts.

-L label

Specifies labels to be used in place of corresponding file names in conflict reports. May be given up to three times.

-p

Print result to standard output.

-q

Be quiet about reporting.

-V

Print RCS's version number.

Exit status

The merge utility exits with one of the following values:

0

No overlaps.

1

Overlaps were found.

2

An error occurred.

Examples

Using labels:

$ merge -q -p -L one -L two -L three file1 file2 file3
<<<<<<< one
=======
bar
>>>>>>> three

Releases

61 releases since OpenBSD 2.1; the text changed 5 times.

  1. 2.1
  2. 2.2–3.9
  3. 4.0–4.1
  4. 4.2–4.8
  5. 4.9–6.3
  6. 6.4–8.0

-L since OpenBSD 4.0; -V since OpenBSD 2.2.

-A until OpenBSD 3.9.

Standards

The flag [-A] has no effect and is provided for compatibility only.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.