git match tag with multiple words
问题 We can get the last git tag, which starts by a word(e.g TEST) as follow: git describe --tag --dirty --match 'TEST*' I am wondering how can I get the last tag, which starts by word1 or word2 (e.g. TEST OR RUN)? I've tried to use regex or following but it does not work: git describe --tag --dirty --match 'TEST*|RUN*' SOLUTION: We can get number of commits to HEAD and compare those numbers, the one which has less commits is the more recently. You can find its script in the answer, which I have