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 小时前
013、推送与拉取:git push与git pull的协作流程
大数据·git·elasticsearch
每天进步一点点️2 小时前
GIT - 常用命令合辑
git
csdn_aspnet3 小时前
Git Submodule深度避坑指南,破解子模块同步混乱、版本漂移、CI失败等高频协作痛点
git·ci/cd·submodule·checklist·detached·subtree
一个程序猿老马3 小时前
011、更优雅的合并:git rebase变基操作详解
git
zhensherlock6 小时前
Protocol Launcher 系列:Working Copy 文件操作与高级命令详解
javascript·git·typescript·node.js·自动化·github·js
摆烂z20 小时前
AI同时完成多个功能(Git WorkTree)
git
___波子 Pro Max.1 天前
Git Worktree 可视化理解指南
git
happymaker06261 天前
git使用快速入门
git
不做超级小白1 天前
从零到可用:在手机上用 Termux + Git + Obsidian 打造稳定同步环境(踩坑全记录)
git·智能手机
凡客丶1 天前
Git安装与使用保姆教程【超详细】
git