Merging

Overview

After branching, making changes, and receiving approval for merging those changes through code review, the last step is to merge your development branch back into the main branch.

There are two situations that you need to be aware of when merging your branch.

  1. Merging without Conflicts This means that no-one has modified the same files you were working on, in the original branch, while you were working on the branch.

  2. Merging with Conflicts This means someone has modified the same files you were working on in the original branch.

In case #1, you can just overwrite the original files with your changes, but in case #2 you will need to resolve the conflicts.

For Rockwell Studio 5000 and Siemens Step7 TIA Portal, Copia provides and Advanced Merge tool to allow you to choose what sections of the code you want to include. Refer to these links for resolving merge conflicts using that software. For other merge conflict, a manual merge process may be required.

Desktop App Merge (no conflicts)

To merge your development branch back into main, click into the Current Branch dropdown, select the main branch, and click on the Choose a Branch to Merge into main button.

Select your development branch and press the Merge button. If you do not have any merge conflicts, the merge will perform as expected.

circle-info

While you can always directly merge your changes back into the main branch, Copia recommends that you get into the habit of always creating a PR.

Desktop App merge (with conflicts)

circle-exclamation

If you attempt to merge a branch and someone else has already modified the file(s) within the main branch, you'll get the following warning:

You'll want to select your local version (the option NOT prefixed with origin/) and merge the files in. This will create a new commit. You can then navigate to the History tab to understand what you changed. We recommend you create another commit with the changes from remote that you overrode before pushing.

Last updated

Was this helpful?