I clone my source using git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git w/. Then I specify a specific branch/tag by doing git checkout
git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git w/
git checkout
git branch
tells you what branch you're on (with a * marker).
*
Tags are just names for revisions, so Git won't tell you that you're "on" a tag, but you can use git name-rev HEAD to get a sense for what it might be.
git name-rev HEAD