In version control, merging (also called integration) is a fundamental operation that reconciles changes made to a version-controlled collection of files.
This is limited[opinion], as a line of text does not represent the structure of source code.
[citation needed] Automatic merging is what version control software does when it reconciles changes that have happened simultaneously (in a logical sense).
Also, other pieces of software deploy automatic merging if they allow for editing the same content simultaneously.
For instance, if two systems have slightly differing versions of a configuration file and a user wants to have the good stuff in both, this can usually be achieved by merging the configuration files by hand, and picking the wanted changes from both sources (this is also called two-way merging).
In these cases, revision control systems resort to the user to specify the intended merge result.
Sections that are different in all three files are marked as a conflict situation and left for the user to resolve.
There are awkward cases, particularly the "criss-cross merge",[3] where a unique last common ancestor of the modified versions does not exist.
Since there is a finite number of versions in the history, the process is guaranteed to eventually terminate.
In the Unix world, there has been a tradition to disseminate changes to text files as patches in the format that is produced by "diff -u".
Patch commutation is used in Darcs to merge changes, and is also implemented in git (but called "rebasing").
Patch commutation requires that the exact changes that made derivative files are stored or can be reconstructed.
It is also one of the merge options of the GNU Bazaar revision control tool, and is used in Codeville.