How do I determine what branch/tag I have checked out in git?

前端 未结 4 1935
感动是毒
感动是毒 2021-01-14 12:01

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

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-14 12:17

    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.

提交回复
热议问题