Merge Two Different Trees
This merge type is useful when you need to duplicate changes from one child branch (for
example, CB1
) to another child branch (CB2
) from the same
parent branch. The SVN client will calculate the changes necessary to get from the
HEAD
revision of the parent branch (or the trunk) to the
HEAD
revision of one of its child branches (CB1
), and
apply those changes to your working copy of the other branch (CB2
). The
result is that the latter child branch (CB2
) will also include the changes
made on the original child branch (CB1
), although that branch was not
reintegrated into the parent branch.
This merge type could also be used to reintegrate a child branch back into its parent when the repository does not support merge tracking.
-
Go to menu
.The Merge wizard is opened.
- Select the option Merge two different trees.
-
It is recommended that you select the Perform pre-merge best practices
checks of the working copy target option to make sure that the working copy
target item is ready for the merge operation.
-
Click the Next button.
The Merge two different trees wizard is displayed.
-
In the From (starting URL and revision) section, enter the URL of
the first branch.
You may also click the Browse button to browse the repository and find the desired branch. If you have previously merged from this branch, then you can simply use the drop-down menu, which displays a history of previously used URLs.Tip: If you are using this method to merge a feature branch back to its parent branch, you need to start the merge wizard from within a working copy of the parent. In this field enter the full URL of the parent branch. This may sound wrong, but remember that the parent is the starting point to which you want to add the branch changes.Note: If the URL belongs to a different repository than the working copy, the Ignore ancestry / Disable merge tracking option (in the Merge Options wizard page) will be selected automatically (and you cannot change this). This is because the Subversion client cannot track changes between different repositories.Tip: You can also specify a peg revision at the end of the URL (for example,
URL@rev1234
). By default, theHEAD
revision is assumed. -
Enter the last revision number at which the two trees were synchronized by choosing
between HEAD revision and other
revision.
- HEAD revision - Use this option if you are sure that no one else has committed changes since the last synchronization.
- other revision - Use this option to input a specific revision number and avoid losing recent commits. You can use the History button to see a list of all revisions.
-
In the To (ending URL and revision) section, enter the URL of
the second branch.
You may also click the Browse button to browse the repository and find the desired branch. If you have previously merged from this branch, then you can simply use the drop-down menu, which displays a history of previously used URLs.Tip: If you are using this method to merge a feature branch back to its parent branch, enter the URL of the feature branch. This way, only the changes unique to this branch will be merged, since the branch should have been periodically synchronized with its parent.Attention: The URL must point to the same repository as the one in the From (starting URL and revision) field. Otherwise, the operation will not be allowed, since Subversion cannot compute changes between items from different repositories.Tip: You can also specify a peg revision at the end of the URL (for example,
URL@rev1234
). By default, theHEAD
revision is assumed. -
Select a revision to compute all changes committed up to that point by choosing between
HEAD revision and other revision.
- HEAD revision - This is the default selected revision.
- other revision - Use this option if you want to enter a previous revision. You can use the History button to see a list of all revisions.
-
Optionally, if you want to configure the options for
your merge, click the Next button.
The Merge Options wizard page is displayed that allows you to configure options for the operation.Warning: If the Ignore ancestry / Disable merge tracking option is selected and you chose all revisions in the Revisions to merge section, revisions that were previously merged will also be included, which may result in conflicts.
-
Click the Merge button.
The merge operation is performed.
If the merge is completed successfully, all the changes corresponding to the selected revisions should be merged in your working copy.