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
阿米亚波10 小时前
【C/C++包管理器】vcpkg(by microsoft)
c语言·c++·git·vscode·microsoft·github·vcpkg
苍煜11 小时前
Git Worktree 多工作树实战教学-工作多分支实用教程
git
RainingTime15 小时前
新版IDEA使用传统用户名、密码登录Git
git
DevangLic1 天前
【诡异的空文件夹 和 git:冲突合并】最新的尝试
git
舒一笑1 天前
Windows + WSL2 完整复现 Avernet WAIC 6 Bot 协作演示
人工智能·git·开源
生戎马 平安京策1 天前
git寻根——^和~的区别
git
技术小结-李爽1 天前
【工具】git远程分支合并
git·gitee
RootKai1 天前
Git命令与基本使用流程
git