Does Simulink project git version control only work when the *.prj and .SimulinkProject are placed in the root of the repository?

조회 수: 4(최근 30일)
Flemming
Flemming 2015년 10월 26일
답변: Jiri Findejs 2018년 8월 10일
I can set up a simulink project in git as described in the help-docs without problem, where the *.prj and .SimulinkProject are in the same folder as .git.
However, I have a large already existing git repository that I would like to use for simulink projects. But I do not want to have simulink *.prj and .SimulinkProject lying in the root of the repository. I just want the entire Simulink project to lie in a subfolder of the git-repository. I have tried this, but don't see how to get the project under git source control.
Isn't that possible? I feel I have searched everywhere, but can't find any description this.

답변(2개)

Jiri Findejs
Jiri Findejs 2018년 8월 10일
Anyone aware of any progress on this feature?
I'm trying to setup multiple Simulink projects (R2018a) in one Git repository and the integration with source control still does not work.

goerk
goerk 2015년 12월 3일
I had the same question and got this answer:
We do not support the feature for Git. Our development is aware of this limitation and will try to fix it in future releases.
However currently it is feasible under SVN. Nevertheless we can provide 2 workarounds:
  • Create a root git repository and add Simulink files under this repository. Keep it unlinked from the project manager panel. You will not be able to do git operation when you open a project file, but you will be able to do git operation under the explorer view instead (The default left panel when you do not open any project file).
  • Create a root repository and another git repository linked to the Simulink project. The only issue is that you might have to commit 2 times, one time under root repository and one time under the Simulink project. Nevertheless it looks like git has a mechanism for that called "submodules". This might be the key to not having to commit multiple times. Please find an explication on this link:

Community Treasure Hunt

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

Start Hunting!

Translated by