# Three way comparisons

Three way comparisons show the differences between three different versions of a resource. This feature is most useful when merging resources or when there is a conflict during synchronization. Conflicts occur when two developers add a version from the same branch to their Workbench, then each developer modifies it, then one developer attempts to commit the resource after the other developer has already committed it.

When this situation arises, you can view the differences between three resource versions: the resource in the Workbench, the version of the resource that is committed in the branch, and the common ancestor from which the two conflicting versions are based. If a common ancestor cannot be determined, for example because a resource with the same name and path was created and committed by two different developers, the comparison becomes a two-way comparison.

# Interpreting compare results

The Synchronize view allows you to view the differences between two or three files. If a common ancestor is available, the sync view performs a three way comparison. It is possible that a common ancestor for two conflicting resource versions cannot be determined, (e.g. a resource with the same name and path is created and committed by two different developers). In this case the compare becomes a regular two way compare.

In a three way compare the Workbench shows you:

- what has been changed in the first child in comparison to the common ancestor.
- what has been changed in the second child in comparison to the common ancestor.

In the picture below, the common ancestor is displayed in the top pane of the text compare pane. The differences that you see highlighted are what has changed in the Workbench resource as compared to the common ancestor, and what has been changed in the branch resource as compared to the common ancestor. The sections that differ in all three files are highlighted as differences. Conflicts are shown in red, incoming changes in blue, and outgoing changes in gray.

Synchronizing with a CVS repository

Comparing resources
Synchronizing with a repository
Merging changes in the compare editor
Resolving conflicts
Setting preferences for comparing files
Comparing resources with repository versions

Compare editor
CVS Synchronize view