Skip to content

Instantly share code, notes, and snippets.

@ha7ilm
Last active June 15, 2022 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ha7ilm/afeeddb8b639e0cfbb5ee1076b0a0fb5 to your computer and use it in GitHub Desktop.
Save ha7ilm/afeeddb8b639e0cfbb5ee1076b0a0fb5 to your computer and use it in GitHub Desktop.
How to get the absolute path of the root directory of the current git repo in MATLAB
[~,gcr]=system("git rev-parse --show-toplevel"); gcr=strsplit(gcr,newline); gcr=[gcr{1} filesep]; %root of repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment