Introduction
In case you are using more than one branch, you might want to merge changes from one branch to another. How to do this is shown in the following steps.
Merge by using Distribute to branch
When there are new changes in the Trunk branch, it is very easy to merge them to the feature branch. This can be done by moving to the Trunk branch, do some changes, register them. After that you have to do a merge. This can be done as follows:
- Go to Home.
- Click on Version management.
- Select the correct repository and the correct branch (Trunk).
- Click on Distribute to branch.
- The From field is prefilled with the current branch (Trunk).
- Select the To branch (FeatureBranch).
- It will show the registered changes that can be selected in bold.
- Select one of them.
- In the Details overview you see the elements that have been changed in this commit (which was done in the Trunk).
- Now click on Merge.
- The system performs some checks and presents you an overview with:
- Impact report
- Conflicts (0)
- Merged revisions
- As there are no conflicts you can click on Apply and Close.
- Click on FeatureBranch on the left side and click on Open branch at the top.
- Open the project.
- Click on File > Pending changes.
- Here you see the elements that have been changed.
- In the middle of the screen at Merges you also see the register message which was added in Trunk.
- Now you can also register these changes in this branch.
Merge Update from branch
This action is the opposite of Distribute to branch, but then seen from the other branch.
So it is possible to do the previous steps by using this action. Then you have to open the target branch and do your changes by pulling updates instead of pushing them.
Discard changes
You may have noticed a tiny checkbox in the Distribute to branch overview with the name 'Discard changes'. By selecting this option you explicitly state that you don't want to merge the selected changes. This could be very helpful in case you have to make some changes which are only relevant for that branch, e.g. some test flow or test page. By selecting Discard changes the changes will only remain in the branch in which they have been defined and they will not processed to another branch e.g. Trunk.
Note that changes that have been set to discard changes in the past will never ever be merged.
In case you accidentally ticked discard changes but you still want to acquire these changes you have to create a temporary branch in which the changes are taken over and merge that one to the destination branch.
Note that if you uncheck the 'Show all revisions' toggle, revisions are not displayed in bold anymore and cannot be used to select in order to merge. A work around is to check the toggle.