How to revert using Git on Simulink UI?

18 visualizaciones (últimos 30 días)
MathWorks Support Team
MathWorks Support Team el 25 de Jul. de 2018
Editada: MathWorks Support Team el 20 de Dic. de 2023
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?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 21 de Nov. de 2023
Editada: MathWorks Support Team el 20 de Dic. de 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 comentario
Felix Mireisz
Felix Mireisz el 15 de Mayo de 2023
Hey everyone,
is there in 2023 a solution in MATLAB implemented which makes this possible with the Simulink Project UI?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Project Management en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by