GIT-ROOT(1)
π GIT-ROOT(1) π
okay bestie, welcome to the git-extras manual, page one of one, and it's about git-root β the little command that tells you where your repo actually lives. no cap, it's a short one, but it's iconic. π
β¨ NAME β¨
git-root β show path of root π±
β¨ SYNOPSIS β¨
git root OPTIONS
β¨ DESCRIPTION β¨
it prints the path for the root directory of the git repo. that's it. that's the whole vibe. you get the absolute path of the top of your repo and you can go about your day π
β¨ OPTIONS β¨
-r,--relativeβ instead of the full absolute root path, it shows the relative path from the root directory to your current directory. so like, where am i inside this repo, expressed from the top down. π¦
β¨ EXAMPLES β¨
okay so pretend you're deep in the repo, like this:
$ cd .../git-extras/bin
then ask for the relative version:
$ git root -r
bin/
see how it just says bin/? that's relative to the root, the way that it knows where you are. π€Έ
now ask for the real one, no flags:
$ git root
/home/.../git-extras
and there's the whole path, root directory, served fresh. also you can just teleport there:
$ cd `git root`
$ pwd
/home/.../git-extras
and then, because you're now standing at the root of everything, you can do the classic:
# then we can
$ git add . && git commit
stage it all, commit it all, main character energy fr fr π
β¨ AUTHOR β¨
Written by spacewander <spacewanderlzx@gmail.com> β thank you king, we appreciate you π«Ά
β¨ REPORTING BUGS β¨
found something cursed? tell the people, don't suffer in silence:
<https://github.com/tj/git-extras/issues>
β¨ SEE ALSO β¨
<https://github.com/tj/git-extras>β the whole git-extras situation, go be nosy, iykyk π
and that's a wrap, bestie π this little page is from the Git Extras source, dated May 2026, and it goes by GIT-ROOT(1). now go find your root and slay πβ¨π
π¦ where this page comes from
- ubuntu stonking: git-extras 7.5.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms