How can I log the branch that I am currently working in?

조회 수: 4 (최근 30일)
Erik-Jan van Harn
Erik-Jan van Harn 2019년 4월 29일
편집: Jan 2019년 4월 29일
Hi,
I am trying to include the branch I am currently working in, in my log file. You can directly ask for the branch you are working by typing "!git branch" in the command window, but I am unable to store the resulting branche to a variable so I can actually log it.
Does anyone have experience? I don't want to hard code the branch in use, since this seems a littile vulnerable to mistakes.
Thanks,
Erik-Jan
  댓글 수: 3
Erik-Jan van Harn
Erik-Jan van Harn 2019년 4월 29일
Perfect, thank you sir!
Adam Danz
Adam Danz 2019년 4월 29일
I'll make use of that, too, Jan! That should be an 'answer'.

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

채택된 답변

Jan
Jan 2019년 4월 29일
편집: Jan 2019년 4월 29일
[status, msg] = system('git branch');
Then use msg afterwards.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by