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
Since Git 2.13.0, it supports a new option to show the path of the root project, which works even when being used from inside a submodule:
git rev-parse --show-superproject-working-tree