Command
git rev-parse --show-toplevel
Reports the absolute root path of the working tree, including when invoked from a subdirectory. This entry covers only the top-level query, not all rev-parse modes.
Formal Syntax & Structure
git syntaxgit
git rev-parse --show-toplevelWorking Example
Example Snippetgit
git rev-parse --show-toplevel