GIT删除remote/local tag

来源:互联网 发布:java 写入word文档 编辑:程序博客网 时间:2024/06/04 19:21

GIT的tag功能很方便我们查找某个版本,但是经常有时候打错了tag,并且上传到了remote,那么如何删除呢?

Windows下我们经常用的就是TortoiseGit,他确实可以删除本地local tag,但是很抱歉我没有发现他又删除remote tag的功能,看起来只能求助于GitBash。

GitBash中确实有删除local/remote tag命令。下面分别列一下删除local、remote tag的命令:

删除local tag "vXXXX"

#del local taggit tag -d vXXXX#list local taggit tag
删除remote tag "vXXXX"

git push origin :refs/tags/vXXXX

用的正是

git push where-to-push source-ref:destination-ref

git push origin refs/tags/release-1.0:refs/tags/release-1.0

也就是用空的tag来替代remote tag vXXXX




0 0
原创粉丝点击