Merge conflicts and synchronize streams

Merging is performed in one direction, but you can synchronize the streams by merging changes in both directions. When merging streams, conflicts can be resolved automatically or manually.

Synchronize streams

In a merging operation, you apply the changes from one stream to another. But you may need to merge changes in both directions and synchronize the two streams.

Use the following methods to synchronize streams:

  • Merge in one direction and then use the Swap option in the Merge wizard to merge in the opposite direction. The target in the first merge becomes the source in the second merge. You also need to change the work area to match the target stream for the second merge.

  • Sometimes it may be faster to branch a new stream instead of merging a very large number of files. First merge the stream containing fewer changes into the other stream. Then create a new stream based on the target of the previous merge operation. The result is two identical streams from a single merge operation.

Back to top

Merge conflicts across streams

If there are conflicts during merge, some of them can be resolved automatically, and others require manual intervention.

A file modified in multiple streams is merged automatically unless there is a conflict in the file contents, or the Auto merge non-conflicting file content option was disabled for the merge.

When manually resolving a conflict, you can select one of the following resolutions:

Use repository Apply the changes from the source stream to the work area.
Use local Keep the changes in the work area associated with the target stream.
Merge If the file was modified in both streams, manually select which changes to apply.
Ignore Do not merge the changes. You can resolve them later.

If a conflict includes path differences, resolve the conflict by choosing which path to use:

Use local path The path of the work area.
Use repository path The path of the source in the repository.

You can choose different resolutions for content and path changes, for example:

  • Merge the contents and apply source code changes from both streams.

  • Select the repository path (if the file was independently refactored to different paths in both streams).

    manual_resolution_options.png

The Merge wizard preselects intelligent resolutions based on the origin of the changes. For example, if a file has content change in stream A and a path change in stream B, the wizard automatically resolves the conflict by using the content from stream A and the path from stream B.

Back to top

See also: