How to connect a Simulink Project to an existing Git repository.

2 views (last 30 days)
Hi all,
I am working on a project which, among others, includes several Matlab/Simulink files. I am currently performing version control through Git (for instance, I have Git Bash installed). However, with this setup, I found extremely hard to merge two branches when there are different version of the same Simulink model, since Git open .mdl files as text files. On the other hand, I have discovered that it is possible to perform version control through Git directly from Simulink! That is AMAZING!
Nevertheless, I have to setup my environment to be able to do that, and I have a couple of questions. Assume that my working folder is called MyProject and I am currently tracking some files/subfolders in there.
1. To start using Simulink project together with Git, I don't understand if I should create a new Simulink Project with MyProject as "main" directory and then "Select from Source Control" indicating the already existing remote repository, or if I should do the other way around, i.e.I have to select "Add project to source control" and then perform a "push" to the remote repository to have everything aligned.
2. If I change some non-matlab file (e.g. some .txt or .xml file), can I still use Git with Git Bash, or I necessarily have to use Simulink GUI all the time?

Answers (0)


Find more on Project Management in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!