You are here: Merging Files Between Branches > Duplicating selected changes across branches

Duplicating selected changes across branches

Duplicating change to choose a set of changes made in one branch and apply them to another branch. You can select specific files with changes to duplicate or you can duplicate changes based on a changelist, issue, or label. Specific changes can be duplicated to any branch in the same branch tree without promoting changes to a common parent first.

For example, Steve makes a change in his workspace branch that fixes an issue related to two different products. He can duplicate the changes in files attached to the issue to each product's baseline branch without merging all other changes he made in his workspace branch. After duplicating, he can track the changes to make sure the changes are included in all branches that contain files attached to the related issue.

Note: Only changes that affect the file version, such as changes to file contents or file addition and removal, can be duplicated.

1. To duplicate changes associated with specific files, select the files and choose Branch > Duplicate Changes.

To duplicate changes associated with a changelist, issue, or label, choose Branch > Duplicate Changes.

The Duplicate Changes dialog box opens.

2. Select the branch that contains the changes in the From Branch list. If you selected files before opening the Duplicate Changes dialog box, the branch containing the files is already selected.

3. Select the To Branch to duplicate the changes to.

4. Select a Select files and versions by option. If you selected files with changes before opening the Duplicate Changes dialog box, <Selected files> is selected and the files are displayed.

5. Select a file and click the Edit button in the Differences between versions column to select different historical file versions to duplicate changes from. If multiple actions incremented the file version number, you can change the file versions to duplicate from to ensure that all changes are duplicated and to avoid auto-merge conflicts.

The History dialog box opens. Ctrl+click two file versions and click Select Versions.

6. Click Track Changes to view the branches that include the selected changes.

The Track Changes dialog box opens. You can view changes in branches by changelist, issue, or label. See Tracking duplicated changes

7. Click Preview.

The Duplicate Changes Preview dialog box opens. Files that will be duplicated, files that will not be duplicated, reasons for duplicating, and the file versions that will be used to duplicate changes are displayed. See Duplicate changes preview.

8. Select Label changed files in destination to label the files in the destination branch. Select a label or select <New label> to create a new label. See Creating labels. Click Select to view label details or search for a label. See Selecting labels.

Labels are only added to files that are successfully duplicated, force overwritten, or merged locally. Any duplicate comments you entered are also added to the label history.

9. Select a file and click Duplicate Changes to duplicate it or click Duplicate All to duplicate all files.

The Duplicate Changes Status dialog box opens. You can perform many of the same actions available in the Duplicate Changes Preview dialog box.

10. Click Close when you finish.

 

Additional documentation  Knowledgebase  |  Blog  |  Technical support