Walk up and down the directory tree in search of a GIT_DIR
.
By default, git init
creates a GIT_DIR
named .git
in the current working directory. However, it can be provided the env var GIT_DIR
to create the git directory elsewhere.
e.g. GIT_DIR=foobar git init .
results in a GIT_DIR
named foobar
instead of .git