How to revert using Git on Simulink UI?

조회 수: 27 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2018년 7월 25일
편집: MathWorks Support Team 2023년 12월 20일
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?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 11월 21일
편집: MathWorks Support Team 2023년 12월 20일
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
Felix Mireisz
Felix Mireisz 2023년 5월 15일
Hey everyone,
is there in 2023 a solution in MATLAB implemented which makes this possible with the Simulink Project UI?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Project Management에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by