Resolving conflicts

When updating or committing you may encounter conflicts. A conflict occurs when you have locally modified a resource for which a more recent revision is available in the branch in the repository. Specifically, the branch will contain a revision newer than the base revision of your resource. In this situation you can choose to do one of the following:

Typically, you will want to take the third option, that is to merge, because of the loss of work issues with the other two choices.

Manually merging changes

The Synchronize View indicates those resources which are in conflict with the branch. For a given resource in conflict, typically you will want to merge your changes with changes in the branch's resource.

For example, let us assume that both you and another team member have modified the same html page. Opening that resource from the Synchronize view will display a comparison of the local resource and the branch revision. By cycling through and merging the individual changes, you can decide for each change whether to accept the incoming change, reject it, or merge it with your local changes. When you are finished merging, you save your changes. This overwrites your local resource with the result of the merge. You can subsequently commit this merged resource.

Tip: When merging changes, it is often convenient to be able to distinguish which files you have completed merging. When you're done merging a file, you can pick Mark as Merged from the context menu. This will change the status of the file from being a conflict to being an outgoing change.

You can merge differences in the Synchronization view on two levels:

Auto merging changes

It is also possible to have your changes automatically merged for you. For any resource marked as ASCII, performing a Team > Update will automatically merge into your local resource differences with the branch resource. This works fine provided there are no lines with conflicting changes. If there are, VCS inserts special markup in the file to indicate those lines which could not be merged.

Updating from within the Synchronization view works a bit differently. In the case of a conflict, Update will only process files whose contents contain no conflicts. Files that have content conflicts will be skipped and left in the Synchronize view as conflicts.

Three way comparisons Synchronizing with the repository
Committing
Comparing resources
Merging changes in the Compare editor Compare editor