You may be interested in the output of
git symbolic-ref HEAD
In particular, depending on your needs and layout you may wish to do
basename $(git symbolic-ref HEAD)
or
git symbolic-ref HEAD | cut -d/ -f3-
and then again there is the .git/HEAD
file which may also be of interest for you.