How to find the path of the local git repository when I am possibly in a subdirectory [duplicate]
git rev-parse –show-toplevel could be enough if executed within a git repo. From git rev-parse man page: –show-toplevel Show the absolute path of the top-level directory. For older versions (before 1.7.x), the other options are listed in “Is there a way to get the git root directory in one command?”: git rev-parse –git-dir That would … Read more