repository root
The top folder of a repository's working tree, the one that contains the .git directory.
In more detail
Git commands work from any subdirectory because Git walks up the folders until it finds .git, and paths in its output are relative to this root. git rev-parse --show-toplevel prints it.
Related terms
- git rev-parse — A low-level command that turns a name such as HEAD, main or HEAD~1 into an object ID, and answers questions about the repository.
- .git directory — The hidden directory at the root of a repository where Git keeps all of its data: objects, refs, HEAD, config and the index.
Taught in
- A Repository Is A Folder With A Memory — Advanced Git Internals & Distributed Workflows
- Ignoring Files, And The Tracked File Trap — Advanced Git Internals & Distributed Workflows