Do show the top-level working dir.
[git-shortcuts.git] / git-find-git-dirs
blob5850959ebf9593effcc09688908acd6e93191fcd
1 #!/bin/bash
3 # find-git-dirs -- A simple script to "find" (i.e., "print") the GIT_DIR, as assumed by Git. (Useful if you are in a subdir, and you are not sure about the top-level repo dir.)
5 SUBDIRECTORY_OK=yes
6 . "$(git --exec-path)/git-sh-setup"
8 echo "GIT_DIR=$GIT_DIR"
10 # And now, a way to print the working dir (suggested at http://stackoverflow.com/q/6748083/94687 ):
11 echo 'And "git rev-parse --show-toplevel" tells us about the working dir:'
12 git rev-parse --show-toplevel