Simulink Merge Conflicts - AD-EYE/AD-EYE_Core GitHub Wiki
Resolving conflicts with Simulink three-way merge
Three-Way Merge is to understand and resolve the differences between two conflicting Simulink design changes.
Creating a conflict and merging
- Open MATLAB, the process begins with right-click anywhere on the current folder section and open
Branches
.
- Under
Branches
section, we can see the current branch name (your branch) on the top left side. After that, choose a selected branch (i.e. intern_dev) under Branch Browser. We can see the differences between your branch and a selected branch on right side section. Carefully check each difference and then click on the merge button.
- Now, because of the conflict, you will receive the error.
- If you go back to the current folder section, the conflicting files with red conflict symbol will look like:
- Right click on the file and select View Conflicts to launch the Three-Way Model Merge tool. You will then be able to see:
Resolving the conflicts.
- In the bottom left section of the Three-Way Model Merge, for each block and signal, you can select which version you want to be merged in the target model. For conflicts that cannot be automatically merged, you can manually fix them in the target model and individually mark them as resolved.
-
At the top, Theirs, Mine, and Base columns show the differences in the conflicting revision (selected branch simulink model), your revision (your branch simulink model), and the base ancestor of both files respectively.
-
Underneath, the Target panel shows the local file that you will merge changes into. The Merge tool already automerged the differences it can merge.
- In the Target model panel, select a version to keep for each change by clicking the buttons in the Target pane. You can merge modified, added, or deleted nodes, and you can merge individual parameters. The Merge tool selects a choice for every difference it could resolve automatically. Review the selections and change them if you want. Look for warnings in the Conflicts column. Select a button to use Theirs, Base, or Mine for each conflicted item (see the colour symbol for each button section).
- Some differences you must merge manually. In the Target panel, look for the manual merge icon in the Conflicts column that shows you must take action. Then, select the check option to mark the node as complete.
-
Examine the summary table (right besides Target panel) to see the number of automatic merges and remaining conflicts you need to resolve.
-
Once you are satisfied with the target model, click Accept and Close. Now the conflicts have been resolved for that Simulink model. Repeat this process for each Simulink models in which if you can see the red conflict symbol.