git-describe

根据最近的标签描述当前提交

补充说明

git describe 从最近的 tag 推导版本字符串,常用于构建版本号、制品命名和发布脚本。它依赖标签历史,浅克隆或没有 tag 时会退化。

常用示例

git describe --tags
git describe --tags --always
git describe --tags --dirty
git describe --tags --long
git describe --tags --match 'v*'
git describe --tags --exact-match
git describe --tags --abbrev=12 HEAD
git describe --tags --first-parent

易错点与排错

相关命令