To merge files and directories:
Diff Merge is used to compare contributors and resolve differences. Diff Merge writes the resolved changes to the merge output file.

The merge output file is usually checked in as the destination version in the target stream.
A merge is a straightforward extension of a file comparison. Instead of displaying the differences, Diff Merge analyzes them (sometimes with your help) and copies sections of text to the output file:
------------[changed 3-4]----|--------[changed to 3-4 file 2]---
now is the thyme | now is the time
for all good men | for all good people
-|-
*** Automatic: Applying CHANGE from file 2 [lines 3-4]
============
(You can turn off automatic acceptance of this kind of change.)
[changed 10] | [changed to 10 file 2]---
cent | sent
-|-
[changed 10] | [changed to 10 file 3]---
cent | scent
|-
Do you want the CHANGE made in file 2? [yes]
no
Do you want the CHANGE made in file 3? [yes]
yes
Applying CHANGE from file 3 [line 10]
============
Be sure to verify that the changes you accept produce consistent merged output. For example, after performing a merge involving file util.h, you can compare files util.h.contrib (which contains its previous contents) and the new util.h (which contains the merge output).
If all the contributors are versions of the same element, Diff Merge determines the base contributor automatically. It examines the version tree of the element, which includes all the merge arrows created by previous merge operations. This examination reveals the relationships among versions from the standpoint of their contents (which versions contributed their data to this version), rather than their creation order (which versions were created before this version). Diff Merge selects as the base contributor the closest common ancestor in this enhanced version tree.
The following figure illustrates a common case of merging and the determination of the base contributor for a merge.

If no merges have been performed in the element, the actual common ancestor (5) of the contributors (test/4 and windows/1) in the version tree is selected to be the base contributor.
If the contributors are not all versions of the same element, there is no common ancestor (or other base contributor). In this case, automated merging is turned off, and you must resolve all discrepancies among the contributors.
Under the following conditions, the merge is recorded by creating one or more merge arrows (hyperlinks of type Merge):
Diff Merge draws an arrow from each contributor version (except the base contributor) to the target version. You can see merge arrows with the Version Tree Browser.
The find and lsvtree -merge commands can locate versions with Merge hyperlinks. The describe command lists all of the hyperlinks of a version, including merge arrows:
cleartool describe util.h@@/main/3version "util.h@@/main/3" . . . Hyperlinks: Merge@278@/vob_3 /vob_3/src/util.h@@/main/rel2_bugfix/1 -> /vob_3/src/util.h@@/main/3
Each version of a Rational ClearCase directory element contains the names of certain file elements, directory elements, and VOB symbolic links. Diff Merge can process two or more versions of the same directory element, producing a directory version that reflects the contents of all contributors. The algorithm is similar to that for a file merge. Diff Merge prompts for user interaction only when two or more of the contributors are in conflict.
One of the directory versions, the merge target, must be checked out. (Typically, it is the version in your view.) Diff Merge updates the checked-out directory by adding, removing, and changing names of elements and links.
If you follow this procedure, it is easier to determine exactly what the merge accomplished. Enter a diff -predecessor command on the checked-out version, which has just been updated by merge.