The following example describes a simple three-way merge.
A mainline stream is created, which also creates a new version of the stream (#0).
Changes are delivered to the mainline, which creates another new version (#1).
Further changes are delivered to the mainline, which creates a new version (#2).
A new feature stream is branched off the mainline from version #1. This creates a new version (#0) of the feature stream. Note that the feature stream is based an older version of the mainline (#1) and not the most recent version (#2).This is useful when the latest stream changes are unstable, not tested, or not required for a branched stream.
Changes are delivered to the feature stream, which creates a new version (#1).
Feature stream version #1 (the source stream) is merged into mainline stream (the target stream). The common ancestor for both streams is mainline stream version #1. A new version of the mainline stream (#3) is created after the merge results are delivered.
Further changes are delivered to the feature stream which creates a new version (#2)
When the feature stream is merged again into the mainline stream, the difference between the feature stream versions #1 and #2 is calculated. The common ancestor is feature stream version #1 and only the items that have changed are merged. A new version of the mainline stream (#4) is created.
Related Topics
Merging Changes across Streams
Merging Changes from a Baseline into a Stream