Simple three-way merge

The following example illustrates a simple three-way merge.

3-way_merge.png

This three-way merge includes the following steps:

  1. A mainline stream is created, which also creates a new version of the stream (#0).

  2. Changes are delivered to the mainline, which creates another new version (#1).

  3. Further changes are delivered to the mainline, which creates a new version (#2).

  4. 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.

  5. Changes are delivered to the feature stream, which creates a new version (#1).

  6. 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.

  7. Further changes are delivered to the feature stream which creates a new version (#2)

  8. 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.

Back to top

See also: