git-root - Man Page

show path of root

Examples (TL;DR)

Synopsis

git root Options

Description

print the path for the root directory of git repo

Options

-r, ā€‰--relative
show the relative path from root directory to current directory

Examples

$ cd .../git-extras/bin
$ git root -r
bin/
$ git root
/home/.../git-extras
$ cd `git root`
$ pwd
/home/.../git-extras
# then we can
$ git add . && git commit

Author

Written by spacewander <spacewanderlzx@gmail.com>

Reporting Bugs

<https://github.com/tj/git-extras/issues>

See Also

<https://github.com/tj/git-extras>

Referenced By

git-extras(1).

October 2017 Git Extras