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 。

相关推荐
浅念-3 小时前
一文吃透Git:本地操作|冲突处理|远程协作|GitFlow工作流详解
大数据·git·elasticsearch·搜索引擎·gitflow
滕州市燕猫虎计算机科技工作室个体工商户7 小时前
Git常用命令汇总
git
czhc11400756639 小时前
2026-09-11 一日综合:树的父链、git 概念、三方死锁、静默失败
大数据·git·elasticsearch
ChampaignWolf9 小时前
abapgit-agent:用 Git 当中介,让 Claude Code 自己完成 ABAP 闭环开发
git·ai·abap·claude·abapgit·mcp
嘴贱欠吻!10 小时前
如何成为 CJMP 贡献者:AtomGit贡献流程与要求
git·ci/cd
滕州市燕猫虎计算机科技工作室个体工商户10 小时前
.gitignore文件不生效的解决方法
git·.gitignore·.gitignore不生效
hasty12 小时前
一个 Git 分支名,如何穿透到 CI Runner 的 Shell?
git·ci/cd
橘色的喵14 小时前
Claude Code 状态栏脚本:一行显示模型、上下文占用、git 分支和当前目录
linux·git·bash·claude
fangjianj14 小时前
git 常用命令
git
hasty16 小时前
execSync() 拼接 Git 参数的代价:从元数据到供应链执行
git·安全·安全性测试