git rev-parse Table of Contents git rev-parse Get the git root directory Get the short hash git rev-parse reference Get the git root directory howto git rev-parse --show-toplevel http://stackoverflow.com/questions/957928/is-there-a-way-to-get-the-git-root-directory-in-one-command Get the short hash howto git rev-parse --short HEAD https://stackoverflow.com/questions/5694389/get-the-short-git-version-hash