跳转到内容

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/headGET(仅 --target 未指定时调用)
创建 tag${CNB_API_ENDPOINT}/{repo}/-/git/tagsPOST

另请参阅

Released under the MIT License.