How merging works
A merge combines the contents of two or more files or directories into a single new file or
directory. The DevOps Code ClearCase® merge algorithm
uses the following files during a merge (see Figure
1):
- Contributors, which are typically one version from each branch you are merging. (You can merge up to 15 contributors.) You specify which versions are contributors.
- The base contributor, which is typically the closest common ancestor of the contributors. (For selective merges, subtractive merges, and merges in an environment with complex branch structures, the base contributor may not be the closest common ancestor.) The DevOps Code ClearCase merge algorithm determines which contributor is the base contributor.
- The target contributor, which is typically the latest version on the branch that will contain the results of the merge. You determine which contributor is the target contributor.
- The merge output file, which contains the results of the merge and is usually checked in as a successor to the target contributor. By default, the merge output file is the checked-out version of the target contributor, but you can choose a different file to contain the merge output.
Merging files and directories involves the following actions:
- The base contributor is identified.
- Each contributor is compared against the base contributor. (See Figure 2.)
- Any line that is unchanged between the base contributor and any other contributor is copied to the merge output file.
- Any line that has changed between the base contributor and one other contributor
is accepted in the contributor.
Depending on how you started the merge operation, the change may be copied to the merge output file. However, you can disable the automated merge capability for any given merge operation. If you disable this capability, you must approve each change to the merge output file.
- For any line that has changed between the base contributor and more than one other contributor, you are required to resolve the conflicting difference.
To merge versions, you can use the graphic user interface (GUI) tools or the command-line interface.