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 。

相关推荐
高山莫衣1 小时前
git rebase多次触发冲突
大数据·git·elasticsearch
码农藏经阁1 小时前
工作中常用的Git操作命令(一)
git
kobe_OKOK_2 小时前
【团队开发】git 操作流程
git·elasticsearch·团队开发
码农垦荒笔记2 小时前
Git 安装闭坑指南(仅 Windows 环境)
windows·git
CC码码12 小时前
管理你的多个 Git 密钥(多平台多账号)
git·gitlab·github
CC码码12 小时前
管理你的多个 Git 密钥(单平台多账号)
git·gitlab·github
大卫小东(Sheldon)12 小时前
GIM 1.5发布了! 支持Windows系统了
git·ai·rust
flying jiang12 小时前
将大仓库拆分为多个小仓库
git
李boyang10 天前
Git(四):远程操作
git
荻野泽溪10 天前
Git新建分支并同步到远程
git