For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get the path to the repository root

It's often handy in scripts to get the (absolute) path to the current git repository.

git rev-parse --show-toplevel

Source: LESS='-p ^\s*--show-toplevel' man git-rev-parse

Last updated