visionmedia/git-extras — pull request #126 by agrimaldi (2012-07-16 15:15:01+00:00)
Title: Use git describe to fetch last tag

The current way of getting the last tag seems to be problematic to some people (#44) including myself.

git provides a nicer way to get the last tag with ```git describe```. (found [here](http://stackoverflow.com/questions/1404796/how-to-get-the-latest-tag-name-in-current-branch-in-git))

The provided changes allow to fetch the last tag on all branches.
To get the one on the current branch only, this can be used instead.

```shell
version=$(git describe --tags --abbrev=0)
```