Search code examples
gitmatlab

MATLAB git by command window


I use MATLABs git support in the development of my code, often committing, pushing and all the standard source control stuff.

However, I have only used MATLABs user interface that basically works by right clicking on the folder and navigating through the menu until the right choice is found (see image below).

Is there a way to make MATLABs command window run git commands, instead of needing to navigate trough the menu each time?

enter image description here


Solution

  • You can use the system command line escape ! for git commands within MATLAB. Eg:

    !git status
    !git commit -am "Commit some stuff from MATLAB CLI"
    !git push
    

    You'll need to have Git installed on your system for this to work.