Source Control in a SIMULINK Project

2 次查看(过去 30 天)
chef13
chef13 2014-11-18
编辑: Divyam 2024-10-14
Hi to everyone,
I am sorry if this is a stupid question but I want to be sure about it.
Until now I was working without SIMULINK projects but just with single SIMULINK models.
Now I would like to switch to SIMULINK projects in order to exploit their Source Control features (In particular I will use GIT).
I read:
------------------------------------------
When you use Git in Simulink Project, you can:
  1. Create local Git repositories.
  2. Fetch files from remote Git repositories.
  3. Create and switch branches.
  4. Merge branches locally.
  5. Commit locally.
  6. Push files to remote Git repositories.
------------------------------------------
So, from what I understand adding Source Control capabilities will allow me to perform all the GIT actions not from terminal but directly inside MATLAB-SIMULINK environment.
These are all the advantages or including source control to my projects will also help me to have a more robust commit-push-pull behavior? I mean, in SIMULINK we use for example .slx files, is it possible that they will be corrupted by a commit-push procedure done just with the GIT commands from terminal?
I hope you understood what I meant.
Thanks for your help,
Fab.

回答(1 个)

Divyam
Divyam 2024-10-14
编辑:Divyam 2024-10-14
Integrating Git with Simulink Projects simplifies conflict resolution and enhances your commit-push-pull workflow through its GUI. It also offers project checks and dependency management, ensuring a consistent environment for all team members.
As @Trevor Fry suggested, marking the ".slx" file as binaries will not corrupt your files even if you execute the commands from your terminal. This is because Git treats binaries as opaque blobs and does not attempt to merge changes in these files until multiple users edit the same file simultaneously. Therefore, a crucial part of using Git for Simulink projects is following the version control best practices and maintaining backups for your files.
For more information regarding the use of Source Control Integration with Simulink environments, check out this presentation from MATLAB Expo: https://www.matlabexpo.com/content/dam/mathworks/mathworks-dot-com/images/events/matlabexpo/uk/2017/team-based-collaboration-in-simulink.pdf
For a tutorial on how to add Git versioning to your Simulink project, you can watch this video from the MATLAB YouTube channel: https://www.youtube.com/watch?v=AJynESuE1dc&ab_channel=MATLAB

类别

Help CenterFile Exchange 中查找有关 Project Management 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by