How to get the path of the current directory relative to root of the git repository?
How about:
$ git rev-parse --show-prefix
From man git-rev-parse
:
--show-prefix
When the command is invoked from a subdirectory, show
the path of the current directory relative to the top-level
directory.