【问题标题】:How do I add a tag to a Github commit?如何在 Github 提交中添加标签?
【发布时间】:2015-07-02 01:23:02
【问题描述】:

在进行 GitHub 提交时,如何在将其推送到远程仓库之前使用 git 命令行选项对其进行标记?

这样的事情可以做吗? git commit -m 'first commit' -tag -a v0.0.1 -m "1st release"

【问题讨论】:

  • 不能在commit 命令之前运行git tag 吗?
  • 创建你的提交,然后标记它。为什么要在单个命令中执行此操作?

标签: github tagging


【解决方案1】:

AFAIK,你不能在一个命令中提交和标记。

git commit -m "prepare for v1.0.0 release"
git tag v1.0.0
git push origin master --tags

你所能做的就是通过&&连接命令:

git commit -m "prepare for v1.0.0 release" && git tag v1.0.0 && git push origin master --tags

【讨论】:

    猜你喜欢
    • 2023-02-09
    • 2012-07-31
    • 1970-01-01
    • 2021-01-31
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    • 2015-01-31
    • 2021-02-11
    相关资源
    最近更新 更多