Friday, 15 March 2013

tagging - Get last git tag matching string -



tagging - Get last git tag matching string -

in git, let's have multiple tags revision numbers, like:

v1.1.0 v1.2.0 v1.2.1 v1.2.3

i'm interested in getting lastly version number tag. if do

git describe --tags --match "v1.2.*"

i v1.2.0 result, want v1.2.3

if want list tags, using specifc order, can (with git 2.0+) utilize sort option. see "how sort git tags?"

git tag -l --sort=refname "v1.2.*" # or (note '-' sign in '-version' reverse order) git tag -l --sort=-version:refname "v1.2.*"

in each case, first result should v1.2.3

git tagging

No comments:

Post a Comment