1. 查询某一 commit 的 tag
git describe --tags --abbrev=0 --exact-match <commit>
2. 查询当前版本的 tag
git describe --tags --abbrev=0 --exact-match $(git rev-parse --short=8 HEAD)
【注意】最后更新于 June 19, 2023,文中内容可能已过时,请谨慎使用。
git describe --tags --abbrev=0 --exact-match <commit>
git describe --tags --abbrev=0 --exact-match $(git rev-parse --short=8 HEAD)