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 。

相关推荐
星晨雪海27 分钟前
Idea中使用Git详细教程
git
丶党玲儿1 小时前
AI-agent工程化(开源git分享)
人工智能·git·开源
笑虾1 小时前
Git 学习笔记 - 合并
git
明月夜&2 小时前
Ubuntu 20.04 Docker 部署 Ollama + DeepSeek-Coder:本地 AI 编程助手实战
git·vscode·ubuntu·docker·大语言模型·智能体
如此热烈走向夏天2 小时前
科研中常用的GIT常用指令
git
辞旧 lekkk3 小时前
【Git】远程操作与标签管理
linux·git·学习·萌新
重生的黑客3 小时前
Linux 开发工具:Git 版本控制与 GDB 调试入门
linux·运维·git
某人辛木3 小时前
Git推送到GitHub仓库遇到的问题
git·github
Robot_Nav20 小时前
Git 项目维护命令指南相关讲解
git·机器人·github
i建模21 小时前
强制同步远程git仓库
git