Skip to content

Instantly share code, notes, and snippets.

@romanz
Created May 12, 2011 08:56
Show Gist options
  • Save romanz/968200 to your computer and use it in GitHub Desktop.
Save romanz/968200 to your computer and use it in GitHub Desktop.
MATLAB Git wrapper (for Linux)
function [status, result] = git(varargin)
cmd = 'unset LD_LIBRARY_PATH; git --no-pager';
for i = 1:numel(varargin)
cmd = [cmd ' ' varargin{i}];
end
switch nargout
case 0, system(cmd);
case 1, [status] = system(cmd);
case 2, [status, result] = system(cmd);
end
@romanz
Copy link
Author

romanz commented May 16, 2011

Use git "--no-pager" option, in case "WARNING: terminal is not fully functional" while running from MATLAB command line.

@romanz
Copy link
Author

romanz commented Oct 15, 2011

'unset LD_LIBRARY_PATH' is used since MATLAB sets it to its own libraries - preventing other extensions to work (e.g. git-cola with PyQt).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment