Main Content

Resolve Conflicts in Models Under Source Control

Conflicts in Simulink® model files can occur when multiple team members work simultaneously on the same model and when keeping both changes in the merged model is not possible. The user must make a decision on which change they want to keep by resolving the conflict in the model file. For example, a conflict occurs when two users change the value of a parameter in two different Git™ branches. Another example is when one user modifies the structure of the model, by deleting a block, and another user on a different Git branch modifies the same block. A conflict occurs in the model file, and the user must make a manual change to fix the merge.

Development practices and model architecture can greatly affect how often model file conflicts occur. Follow these best practices to minimize model conflicts.

  • Use version control systems, such as Git to help you manage changes and resolve conflicts.

  • Pull changes frequently to stay up-to-date with the latest changes, minimize the occurrence of conflicts, and make them easier to resolve.

  • Communicate effectively with your team and understands the scope of their changes to avoid, if possible, two developers working on the same model file.

  • Break up large changes into smaller ones.

  • Componentize your model and use subsystems. For more information, see Subsystems.

  • Set up Git to automatically merge changes in different subsystems, Stateflow® charts, and configuration sets in the same SLX file. For more information, see Automatically Merge Models.

Follow these steps to resolve conflicts in an example collaborative workflow:

You can use the files provided at any of these steps to follow the instructions in the example.

See Also

Related Examples

More About