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 。

相关推荐
嘻嘻仙人2 天前
Ubuntu中 git上传自己的项目和二次上传一般流程
git·github
Patrick_Wilson2 天前
Squash Merge 的血缘陷阱:为什么删掉的代码又活了过来
前端·git·程序员
沉浸学习的匿名网友2 天前
什么是 .gitignore?为什么每个 Git 项目几乎都离不开它?
前端·git
深海鱼在掘金3 天前
Git 完全指南 —— 第3章:理解工作区、暂存区、版本库三个核心
git
江华森3 天前
Git 基础筑基:从原理到团队协作的全栈实战
git
JakeJiang3 天前
Git 必备命令指南:从日常高频到项目开发实战
git
叫我少年4 天前
Windows 中安装 git
git
深海鱼在掘金9 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc10 天前
关于Git Flow
git
蜜獾云10 天前
在Git中配置用户名和密码
git