At some stage during the development process, you will want to merge the changes made on a
branch back into the trunk, or vice-versa. The merge
is accomplished by comparing two points (branches or revisions) in the repository and applying
the obtained differences to your working copy. This process is closely related to the
diff concept.
Note: A branch is a line of development that exists independently of
another line, yet still shares a common history if you look far enough back in time. A
branch always begins life as a copy of something (such as a trunk,
another branch, or tag), and moves on from there, generating its own history.
The Merge... action is available in the Tools menu. The
working copy item selected when you issued the command will be the one receiving the generated
changes. If there is no item selected, the merge operation will be performed on
the entire working copy.
The Merge Wizard
The four types of merging are as follows:
- Merge
revisions - port changes from one branch to another. Note that the
trunk can also be considered a branch, in this context.
- Synchronize
branch - fetch all the changes made on a parent branch (or the
trunk) to a child branch.
- Reintegrate a
branch - merge back a branch to its parent branch (which can also be
the trunk).
- Merge two different
trees - integrate the changes done on a branch to a different
branch.
It is recommended that you enable the following pre-merge check option:
Remember: It is a good idea to perform a merge into an unmodified working copy. If
you have made changes to your working copy, commit them first. If the merge does
not go as you expect, you may want to revert the changes and revert cannot recover your
uncommitted modifications.