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 。

相关推荐
眼小博6 小时前
多人协作Git开发流程指南
git
lpfasd12313 小时前
git-团队协作基础
chrome·git·elasticsearch
John Song15 小时前
git多个账号管理
git·github
CV_J15 小时前
解决Git 冲突后本地提交丢失/未推送问题
git
__Witheart__16 小时前
Git 某个分支恢复到某个特定的 commit 状态
git
XU磊26017 小时前
Git 实现github仓库管理-删除指定目录下的所有文件并保留目录结构
git·github
zhimingwen19 小时前
解决 GitLab Token 轮换后 SourceTree 认证失败问题
git
昵称是6硬币20 小时前
代码管理——VS Code|Git
git·代码管理
Trouville0120 小时前
如何在VScode环境下使用git进行版本控制,并上传到gitee远程仓库
ide·git·vscode
weixin_4233919321 小时前
从开发到合并:AICR 项目 Git 协作提交全流程指南
git