How to revert using Git on Simulink UI?

19 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 25 Juil 2018
I want to revert the entire Simulink Project to a specific revision. How can I do this using Git source control on the Simulink Project UI?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 21 Nov 2023
Modifié(e) : MathWorks Support Team le 20 Déc 2023
It is not currently possible to create an inverse commit from project history directly from the Simulink Project UI.  As a workaround, do the following:
1) Open the git branch manager, find the ID of the commit that you want to revert to, and note that down.
2) Close the project.
3) In MATLAB Command Window, reset the HEAD to the second revision:
!git reset --hard [commitID]
At this point, the HEAD and the "master branch should be at the same location.
4) Create and add a new script into the project.
5) Open Simulink Project and click Commit. 
At the end of this, you should be able to see in the Simulink Project > Branches window similar to the attached file: 
In general, MATLAB path will prevent any source control tool from deleting folders that are on the path. MATLAB's git integration can work around this issue, but command line git might cause problems. If reverting the project will not involve folder deletion, then the project can be kept open (neglecting step 2 from above).
  1 commentaire
Felix Mireisz
Felix Mireisz le 15 Mai 2023
Hey everyone,
is there in 2023 a solution in MATLAB implemented which makes this possible with the Simulink Project UI?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Project Management dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by