Home > database >  How to run git commands through MATLAB script?
How to run git commands through MATLAB script?

Time:11-09

I am trying to run git command through matlab script and get the terminal output. I have had success when running

[status,cmdoutput] =  system('TERM=ansi git diff-tree -r --name-only asdasd asdasdas');

However if I use git diff instead of git diff-tree, I get empty result back. I have tried to run the same command on terminal which runs fine.

OS : Ubuntu 18.04 MATLAB R2020b

Any help is appreciated :)

CodePudding user response:

It might be related to the pager. I've been using the following code without problem on Ubuntu 20.04

[~, cmdoutput] = system('git --no-pager diff --no-color');
  • Related