【问题标题】:Undo tag that's not pushed in Git撤消未在 Git 中推送的标记
【发布时间】:2016-10-02 00:40:33
【问题描述】:

我已经提交了一个标签(使用 git tag -a -m )。我在推送之前发现我需要恢复提交,所以我使用了git revert --soft HEAD~。我如何也删除标签?我已经与git push --tags --dry-run 确认它还没有被推送,所以我希望它可以删除。

【问题讨论】:

  • git revert 没有 --soft 标志。你的意思是git reset

标签: git tags undo revert


【解决方案1】:

只需从您创建标签的分支运行以下命令:

git tag -d <tag name>

即使您已经推送了标签,仍然可以将其删除。看看这个有用的blog post

【讨论】:

    猜你喜欢
    • 2011-08-22
    • 2011-01-24
    • 1970-01-01
    • 2014-05-06
    相关资源
    最近更新 更多