Git 推送和删除远程标签

事实上Git 的推送和删除远程标签命令是相同的,删除操作实际上就是推送空的源标签refs:
git push origin 标签名
相当于
git push origin refs/tags/源标签名:refs/tags/目的标签名


git push 文档中有解释:

tag <<tag>> means the same as refs/tags/<tag>:refs/tags/<tag>.
Pushing an empty <src> allows you to delete the <dst> ref from the remote repository.

推送标签:

[plain]  view plain  copy
  1. git push origin 标签名  

删除本地标签:

[plain]  view plain  copy
  1. git tag -d 标签名  

删除远程标签:

[plain]  view plain  copy
  1. git push origin :refs/tags/标签名  
  2.   
  3. git push origin :refs/tags/protobuf-2.5.0rc1  

其他本地操作:

[plain]  view plain  copy
  1. #打标签  
  2. git tag -a v1.1.4 -m "tagging version 1.1.4"  
  3.   
  4. #删除本地仓库标签  
  5. git tag -d v1.1.4  
  6.   
  7. #列出标签  
  8. git tag   

参考文档:
http://nathanhoad.net/how-to-delete-a-remote-git-tag

http://linux.die.net/man/1/git-push

https://git-scm.com/book/zh/v1/Git-基础-打标签

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值