Merge branches
When you work on a branch, after you've finished the task, you can merge the branch back into another branch, such as your main branch.
Merge your branch in the Unity Cloud Dashboard
You can merge branches in the DevOps section of your Unity Cloud Dashboard:
- Open your repository and select the Branches tab.
- To merge a branch, right-click the branch and select Merge branch into.
- On the Merge page, you can edit the default values in the Destination branch and Source dropdown menus if you want.
- If there are no merge conflicts, select Merge.
- In the dialog, add a comment.
- Select Check-in merge.
Merge your branch in the GUI
Merge from this branch to
To merge a branch without switching to the target branch, use the Merge from this branch to option:
- On the Branch explorer tab, right-click the branch that you want to merge.
- Select Merge from this branch to.
- Select the branch that you want to merge the changes into.
- Select OK.
- Select Check in merge!.
Merge from this branch
You can also configure your current workspace to load the contents of the target branch of the merge, and then you select the source branch to merge from:
- In the Branch explorer tab, right-click the branch you want to merge to.
- Select Switch to this workspace.
- Right-click the branch that you want to merge the changes from and select Merge from this branch.
- Select Apply changes.
- In the Pending changes tab, select Check in.
Merge your branch in the CLI
Run the switch command to switch to the target branch.
If you have pending changes in your current workspace, you can’t switch branches.
cm switch main
Run the
cm merge
command to preview a list of what’s going to merge.cm merge main/task001
Run
cm merge –merge
to actually perform the merge.cm merge main/task001 –merge
If any of the changes require manual merge conflict resolution, the command line launches your default merge tool.
Run
cm ci -m
to check in the merge.cm ci -m "merged from task001"