Merging
Last updated
Last updated
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.
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.
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 an Advanced Merge tool in the web app PR view 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 conflicts, you will need to resolve conflicts manually in the Desktop app.
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.
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.
If Copia's Advanced Merge Tool is available for this filetype, use the Copia Web app instead. Click Here for more information. If you have run into merge conflicts when attempting to merge a PR, follow the instructions below
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.
If you're running into merge conflicts while trying to merge your pull request changes into the base branch, you can resolve them by following these steps:
In the Desktop app, make sure the base branch and the feature branch are up-to-date with the latest remote changes. Select Fetch Origin
from the top bar to pull the latest remote commits for your base branch.
In the Desktop app, merge the base branch into your current feature branch by first ensuring that you are currently checked out in the feature branch, then in Branch settings, choose "Merge into current branch".
After merging changes from the base branch, resolve all conflicts. You should bias towards selecting the changes made in your feature branch.
If you used the Advanced Merge Tool to resolve PLC file conflicts in the web app, it is very important to choose the version of the file from the feature branch
After all conflicts are resolved, commit your merged and resolved changes and push them to your remote repository.
After you've pushed your changes, go back to the web app and ensure that all changes look correct and after merge them into the base/target branch.