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 。

相关推荐
cc蒲公英7 小时前
idea git命令初次创建项目至远程
git
高兴就好(石8 小时前
git将远程的master分支的commit都拉取到本地
git
空空kkk10 小时前
Git版本控制(一)
git
毛豆的毛豆Y11 小时前
git 如何 fork 一个仓库的所有分支
git
测试人社区—841612 小时前
Postman API测试指南
人工智能·git·测试工具·自动化·bug·postman
芒克芒克14 小时前
『Git Tag标签+项目远程操作全解:推送、拉取与版本同步实战』
java·git
fruge15 小时前
前端工程化最佳实践:ESLint+Prettier+Git Hooks 统一开发规范
前端·git
_院长大人_15 小时前
解决 Git 提交大文件导致 Push 被拒绝的问题
java·git·后端·elasticsearch
浪潮IT馆15 小时前
win11安装Git
windows·git
SoulmateShkart16 小时前
Git基本使用命令简略版
git