Get path to repository root To print the absolute path to the current git repository, use: git rev-parse --show-toplevel Found on Stack Overflow