Scenario: Removing the contributions of some versions

A subtractive merge is the opposite of a selective merge: it removes from the checked-out version the changes made in one or more of its predecessors. The following scenario is an example of a situation that requires subtractive merging.

The project manager has decided that a new feature, implemented in versions 14 through 16 on the main branch, will not be included in the product. You must perform a subtractive merge to remove the changes made in those versions.

This figure shows a merge that removes the contributions of some versions. Element opt.c has versions 13 to 18 on the main branch. The contributions from versions 14, 15, and 16 are to be removed and the results written to the target version, which is the checkout of version 18.

Task overview

To perform a subtractive merge, complete the following tasks:
  • Preparing a destination view

    The view must select the target version, which in the figure, is opt.c@@/main/18.

  • Finding changes
  • Removing changes
  • Testing and checking in merge results

For detailed information about completing this task, see the merge and version_selector reference pages.