# man > merge(1)

[_MERGE_(1)](https://www.chedong.com/phpMan.php/man/MERGE/1/markdown)                               General Commands Manual                              [_MERGE_(1)](https://www.chedong.com/phpMan.php/man/MERGE/1/markdown)

## NAME
       merge - three-way file merge

## SYNOPSIS
       **merge **[ _options_ ] _file1_ _file2_ _file3_

## DESCRIPTION
       **merge **incorporates all changes that lead from _file2_ to _file3_ into _file1_.  The result ordinar‐
       ily goes into _file1_.  **merge **is useful for combining separate changes to an original.  Suppose
       _file2_  is the original, and both _file1_ and _file3_ are modifications of _file2_.  Then **merge **com‐
       bines both changes.

       A conflict occurs if both _file1_ and _file3_ have changes in a common segment of  lines.   If  a
       conflict  is  found,  **merge **normally outputs a warning and brackets the conflict with **<<<<<<<**
       and **>>>>>>> **lines.  A typical conflict will look like this:

              **<<<<<<< _**file_ _A_
              _lines_ _in_ _file_ _A_
              **=======**
              _lines_ _in_ _file_ _B_
              **>>>>>>> _**file_ _B_

       If there are conflicts, the user should edit the result and delete one of the alternatives.

## OPTIONS
### -A      -A 
              all  changes  leading  from  _file2_ to _file3_ into _file1_, and generates the most verbose
              output.

### -E -e  -A
              [**diff3**(1)](https://www.chedong.com/phpMan.php/man/diff3/1/markdown)  for  details.   The  default is **-E**.  With **-e**, **merge **does not warn about con‐
              flicts.

### -L _
              This option may be given up to three times, and specifies labels to be used  in  place
              of    the    corresponding    file    names    in    conflict   reports.    That   is,
              **merge -L x -L y -L z a b c **generates output that looks like it came from  files  **x**,  **y**
              and **z **instead of from files **a**, **b **and **c**.

### -p     

### -q     

### -V     

## DIAGNOSTICS
       Exit status is 0 for no conflicts, 1 for some conflicts, 2 for trouble.

## IDENTIFICATION
       Author: Walter F. Tichy.
       Manual Page Revision: 5.10.1; Release Date: 2022-02-19.
       Copyright © 2010-2022 Thien-Thi Nguyen.
       Copyright © 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
       Copyright © 1982, 1988, 1989 Walter F. Tichy.

## SEE ALSO
       [**diff3**(1)](https://www.chedong.com/phpMan.php/man/diff3/1/markdown), [**diff**(1)](https://www.chedong.com/phpMan.php/man/diff/1/markdown), [**rcsmerge**(1)](https://www.chedong.com/phpMan.php/man/rcsmerge/1/markdown), [**co**(1)](https://www.chedong.com/phpMan.php/man/co/1/markdown).

       The  full  documentation  for  RCS is maintained as a Texinfo manual.  If the [**info**(1)](https://www.chedong.com/phpMan.php/man/info/1/markdown) and RCS
       programs are properly installed at your site, the command

              **info rcs**

       should give you access to the complete manual.  Additionally, the RCS homepage:

              **<http://www.gnu.org/software/rcs/>**

       has news and links to the latest release, development site, etc.

## BUGS
       It normally does not make sense to merge binary files as if they were text, but  **merge  **tries
       to do it anyway.

GNU RCS 5.10.1                               2022-02-19                                     [_MERGE_(1)](https://www.chedong.com/phpMan.php/man/MERGE/1/markdown)
