Get latest git tag on master branch with bash

git describe origin/master

Warning: If there are multiple tags (local or remote) for the HEAD of origin/master you will get one tag from this command, not a list.

I recommend using the –match parameter to make sure you get the tag you expect:

git describe origin/master --match="v*"

Reference: http://stackoverflow.com/questions/1404796/how-to-get-the-latest-tag-name-in-current-branch-in-git

Leave a Reply

Your email address will not be published. Required fields are marked *