How to: Merge Branches
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
Merging allows you to copy code from one branch to another, or to synchronize changes between two branches. You can only merge branches if you use TFS as your version control system. For more information about branching and merging in TFS, see Branching and Merging and for more information about how to set up branching for Microsoft Dynamics AX using TFS, see How to: Configure Branching for Version Control.
Merging Branches
Three possible merging scenarios are described below:
You can change your code in a release branch and then merge your changes into the main branch.
You can then merge those changes from the main branch to the development branch, even though the development branch has changes that are not yet reflected in the main branch.
You can also merge your changes from the development branch into the main branch to incorporate the development work that you have done.
To merge a release branch with the main branch
Apply a label to the release branch if the release branch does not already have a label. In Source Control Explorer, right-click the release branch and then click Apply Label. In the New Label screen, specify a name for the label. For example: Release 1.01. Click Create.
Right-click the release branch, point to Branching and Merging, and then click Merge… The Source Control Merge Wizard appears.
On the Select the source and target branches for the merge operation screen: In Source branch, specify the release branch. In Target branch, specify the main branch.
Click Next, and then click Finish.
Resolve any conflicts.
Check in the merged changes to the main branch.
To merge the main branch with the development branch
Right-click the main branch, point to Branching and Merging, and then click Merge… The Source Control Merge Wizard appears.
On the Select the source and target branches for the merge operation screen: In Source branch, specify the main branch. In Target branch, specify the development branch.
Click Next, and then click Finish.
Click AutoMerge or merge the changes manually.
After the conflicts are resolved, click Yes to save the file.
Click Close.
Check in the merged changes to the development branch.
To merge the development branch with the main branch
Right-click the development branch, point to Branching and Merging, and then click Merge… The Source Control Merge Wizard appears.
On the Select the source and target branches for the merge operation screen: In Source branch, specify the development branch. In Target branch, specify the main branch.
Click Next, and then click Finish.
Click Merge Changes in Merge Tool or merge the changes manually.
After the conflicts are resolved, click Yes to save the file.
Click Close.
Check in the merged changes to the main branch.