Synchronize a Branch

While working on your own branch, other people on your team might continue to make important changes in the parent branch (which can be the trunk itself or any other branch). It is recommended to periodically duplicate those changes in your branch to make sure your changes are compatible with them. This is done by performing a synchronize merge, which will bring your branch up-to-date with any changes made to its ancestral parent branch since the time your branch was created or last synchronized. Subversion is aware of the history of your branch and can detect when it split away from the parent branch.

Frequently keeping your branch in sync with the parent branch helps you to prevent unexpected conflicts when the time comes for you to duplicate your changes back into the parent branch. The synchronization uses merge tracking to skip all those revisions that have already been merged, thus a sync merge can be repeated periodically to fetch all the latest changes of the parent branch to keep up-to-date with it.

Important: It is recommended to synchronize the whole working copy that was created from the child branch (the root of the working copy), rather than just a part of it.

After running the synchronize merge, your working copy from the child branch now contains new local modifications, and these edits are duplications of all of the changes that have happened on the trunk since you first created your branch. At this point, your private branch is now synchronized with the trunk.

To synchronize your branch with its parent branch, follow these steps:

  1. Go to Tools > Merge.
    The Merge wizard is opened.
  2. Select the Synchronize branch option.
  3. It is recommended that you enable 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.
    1. Press the Next button.
      If the Perform pre-merge best practices checks of the working copy target option was enabled, the Pre-Merge Checks wizard page is displayed.
      Note: If errors are found you need to solve them before proceeding.
  4. Press the Next button.
    The Synchronize branch wizard page is displayed.
  5. In the Parent branch (URL) text box, enter the URL of the branch from which you created your branch. This means that the URL must belong to the same repository as your working copy that was created from the child 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 list, which shows a history of previously used URLs.
    Tip: You can also specify a peg revision at the end of the URL (for example, URL@rev1234). The peg revision specifies both the peg revision of the URL and the latest revision that will be considered for merging. By default, the HEAD revision is assumed.
  6. Optionally, if you want to configure the options for your merge, press the Next button.
    The Merge Options wizard page is displayed that allows you to configure options for the operation.
    Note: The Ignore ancestry / Disable merge tracking option is not available for this merge type, since a synchronization merge should always be recorded in the destination branch.
  7. Press 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.
It is recommended to look at the results of the merge, in the working copy, to review the changes and see if it meets your expectations. Since merging can sometimes be complicated, you may need to resolve conflicts after making major changes.
Note: The merge result is only in your local working copy and needs to be committed to the repository for it to be available to others.