MATLAB command-line git for Mac?

조회 수: 6 (최근 30일)
the cyclist
the cyclist 2014년 10월 19일
댓글: Bruno Pop-Stefanov 2014년 10월 20일
As of 2014b, MATLAB has native support for git. On a Mac, this seems to only be available via the "Current Folder" GUI.
Is there a way use use MATLAB command-line instead?
Also, is there a way (GUI or otherwise) to do "git status", seeing the status of the repo?

답변 (1개)

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 10월 20일
편집: Bruno Pop-Stefanov 2014년 10월 20일
MATLAB R2014b does support git, but you still have to install it on your system in order to use it with MATLAB. Unfortunately, the command-line features are limited to checkin and checkout. If you want to do git status, for example, you would have to write a simple wrapper that passes the commands to the system, using the system command.
There is one already available on File Exchange:
This should let you use all the functionality that git provides at the command line, instead of using the Current Folder browser.
For detailed info about the integration of git in MATLAB, there are tutorials and links to functions at the following link:
For example, you can refresh the status of files by right-clicking in the Current Folder browser and clicking Source Control > Refresh Git Status.
  댓글 수: 2
the cyclist
the cyclist 2014년 10월 20일
Thanks for the answer. I get the following error when using checkout:
Error using checkout (line 36)
No source control system specified. Set in preferences.
despite having "Enable MathWorks source control integration" ticked in Preferences. Maybe I am doing something wrong?
I had already been using that FEX utility, which is very nice. Unfortunately, the git push command doesn't work via that utility, because of issues the version of libcurl used by MATLAB. (You can read details of this in the comments at the FEX.) This happens even if I issue the command via system. It is possible to jigger the curl files, but I have found it easier to just pop to Terminal to do the push.
I was hoping for something easier with the new native support, though.
Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 10월 20일
I thought checkin and checkout could be used with Git, but they apparently only work with non-MathWorks source control system. In the Preferences, if you select another source control system under the second radio button (below Enable MathWorks source control integration), then checkin and checkout won't throw an error.

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

카테고리

Help CenterFile Exchange에서 Source Control에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by