1. 通过与字符串'XXX*'匹配的tag名称,然后再截取其中的版本号
git describe --tags --match 'XXX*' | cut -d / -f 2 | cut -d - -f 1
2. 在shell脚本中调用以上命令
tag_version="`git describe --tags --match 'xxx*' | cut -d / -f 2 | cut -d - -f 1`"
1. 通过与字符串'XXX*'匹配的tag名称,然后再截取其中的版本号
git describe --tags --match 'XXX*' | cut -d / -f 2 | cut -d - -f 1
2. 在shell脚本中调用以上命令
tag_version="`git describe --tags --match 'xxx*' | cut -d / -f 2 | cut -d - -f 1`"