git之tag操作

  • 查看本地有哪些 tags
shell 复制代码
# git tag -l
v0.0.3
v0.0.5
v0.0.6
  • 查看远程有哪些 tags
shell 复制代码
# git ls-remote --tags
From https://github.com/eyjian/gomooon.git
1fe7f5ecf369cba34f4328285ce1ec72d62c091e        refs/tags/v0.0.3
9371db55046109d7fc9a9f75625d5ec31c326ad1        refs/tags/v0.0.5
bw1vb29umqswcqydvqqldajzatenmasga1ueawwe        refs/tags/v0.0.6

命令格式:

shell 复制代码
git ls-remote --tags <remote_name>

将 <remote_name> 替换为远程仓库的名称,通常为 origin 。

  • 删除本地的 tag
shell 复制代码
git tag -d v0.0.6

命令格式:

shell 复制代码
git tag -d <tag_name>
  • 删除远程的 tag
shell 复制代码
git push origin :refs/tags/v0.0.6

命令格式:

shell 复制代码
git push <remote_name> :refs/tags/<tag_name>

将 <remote_name> 替换为远程仓库的名称,通常为 origin 。

相关推荐
DZSpace24 分钟前
git stash命令用法
git
Vowwwwwww30 分钟前
GIT历史存在大文件的解决办法
前端·git·后端
@BreCaspian1 小时前
Git 推送失败解决教程——error: failed to push some refs to
大数据·git·elasticsearch
该换个名儿了5 小时前
git多个commit合并成一个
前端·git
不爱学英文的码字机器5 小时前
[Git] 分布式版本控制 & 远程仓库协作
分布式·git
Stack_guigui6 小时前
git连接本地仓库以及gitee
git·gitee
火车叼位6 小时前
Git 精准移植代码:cherry-pick 简单说明
前端·git
Cynthia-石头10 小时前
Git Github Gitee GitLab
git·gitee·github
ak啊1 天前
Git 撤销操作完全指南:从工作区到远程仓库的救赎之路
git
小_路1 天前
git 常用命令
git