简体   繁体   中英

git describe a tag that match a glob pattern

I have few tags with the following patterns in chronological order:

0.0.3.156-alpha+2
0.0.3.154
0.0.3.153
build-.139
build-.140
build-.142
build-0.0.1.28
build-0.0.1.29

I need to get the latest tag that match the pattern number.number.number.number hence 0.0.3.154 in this case. The git command git descrive --match=<pattern> will find the latest tag that matches that pattern. But since here is a glob (see here ) and not a regex .

Could you show me the correct glob pattern to match the above?

尝试git describe --tags --match“ [0-1000]。[0-1000]。[0-1000] *”,如果要删除最后一部分,请使用-cut ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM