git tag - Get tags below a particular tag in git -
i trying find out tags less given number. have assigned numbers 1
2000
tags git . now, want display tags below particular tag number.
for example, query number (tag) 1234
, want git display tags less 1234
. how can that?
to make sure understand, want compare tag names numerically? don't want compare tags in terms of commit ancestry?
if so, following shell code should work:
git tag | grep '^[0-9]*$' | while ifs= read -r tag; [ "${tag}" -ge 1234 ] || printf %s\\n "${tag}" done
the above tells git print tags, filters out non-number tags, loops on each numerical tag comparing numerical value. if it's less value, tag name printed.