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 。

相关推荐
江边垂钓者6 小时前
Git简介和发展
git
大卫小东(Sheldon)11 小时前
GIM: 调用AI自动生成git提交消息的工具
git·rust
程序设计实验室12 小时前
如何清理误提交到git的历史大文件?
git
江边垂钓者13 小时前
Git初始化相关配置
git
wumu_Love17 小时前
git 报错:错误:RPC 失败。curl 28 Failed to connect to github.com port 443 after 75000
git·rpc·github
powerfulzyh17 小时前
Git 时光机:修改Commit信息
git
极小狐19 小时前
如何使用极狐GitLab 软件包仓库功能托管 terraform?
linux·运维·git·ssh·gitlab·terraform
等等,要下雨2 天前
git常用命令
git
一直在学习的小白~2 天前
Sourcetree安装使用的详细教程
git
陈苏同学2 天前
从 Git 到 GitHub - 使用 Git 进行版本控制 - Git 常用命令
git·github