Merge

A merge operation combines two or more source artefacts into one object artefact. The term merge is most commonly applied to the combination of two source files into one source file containing the features of the two source files.

Challenges
There are three significant challenges when merging files.
 * 1) Merging binary files—unless a proprietary merge tool is available to merge binary files, it is usually impossible to sensibly automate such merges.
 * 2) Syntactic merge conflicts—when merging files coincident changes to the same syntactic parts of the file will conflict, typically requiring an author to resolve the conflict manually.
 * 3) Semantic merge conflicts—more subtle problems occur when the semantic content of two sources to a merge conflict. This sort of merge conflict is not typically identified by merge tools and can result in subtle errors.

Merging binary files
Absent a specialised tool, merging binary files is not practical.

A classic illustration of the impracticality of merging binary files is the merging of two image files. A simple example will suffice.

Consider the illustrated history of a button image shown below. The initial source button image is modified independently to produce two versions; in the first a colour change has been performed, in the second the shape of the button has been slightly altered and the colour modified.

The binary format of this button (PNG) means that an automated merge would, even if possible, produce either a corrupt file or, at best, unpredictable results. Human intervention is required to judge how the two changes should be combined. Should the colour be taken from the original, the first modification, or the second (or should a new colour be used)? Should the shape the changed, as in the second change, or left as in the original and first change (or, again, should we create a completely new shape)? Not only are these decisions required but their execution demands that an image editing tool be used and the new button produced manually.