cnb-rs repo tag create
cnb-rs repo tag create <NAME> [-t <REF>] [-m <MESSAGE>]创建 tag(lightweight 或 annotated)。
参数
<NAME>: Tag 名(如v1.2.0)
选项
-t, --target <REF>: 指向的目标(分支名 / commit sha / 已有 tag 名);缺省取仓库默认分支 HEAD-m, --message <TEXT>: Tag 描述;带此参数创建 annotated tag,不带创建 lightweight tag
lightweight vs annotated
| 类型 | 是否带 message | 典型用途 |
|---|---|---|
| lightweight | 否 | 临时书签、git workflow 中间标记 |
| annotated | 是 | 正式 release、需要 changelog 信息 |
示例
bash
# Lightweight tag 到 HEAD
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag create v0.13.0-beta
# Annotated tag 到 HEAD
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag create v1.0.0 -m "Stable GA release"
# Annotated tag 到特定 commit
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag create v1.0.1-hotfix \
--target a3f2c1d --message "Backport critical fix #123"API
| 步骤 | API | 方法 |
|---|---|---|
| 取默认分支 | ${CNB_API_ENDPOINT}/{repo}/-/git/head | GET(仅 --target 未指定时调用) |
| 创建 tag | ${CNB_API_ENDPOINT}/{repo}/-/git/tags | POST |
另请参阅
- cnb-rs repo tag
- cnb-rs release create — 想发 release(含附件 + 说明)请用这个