Mercurial has a way of printing the root directory (that contains .hg) via
hg root
Is there something equivalent in git to get the director
If you're looking for a good alias to do this plus not blow up cd if you aren't in a git dir:
cd
alias ..g='git rev-parse && cd "$(git rev-parse --show-cdup)"'