git标签的简单操作

创建标签

bash 复制代码
git tag v1.0 # 对head指向的commit创建标签
git tag v1.1 commit_id # 对指定的commit创建标签
git tag v2.0 -a -m "标签注释" commit_id # 创建注释标签

查看标签

bash 复制代码
git tag -l 'v1*' # 查看标签,匹配v1开头的
git show v2.0 # 查看标签详细信息,包含了diff

推送标签

bash 复制代码
git remove -v # 查看本地库与远程库的对应信息
origin	git@gitee.com:stree_line/test.git (fetch)
origin	git@gitee.com:stree_line/test.git (push)
git push origin v2.0 # 将标签推送到远程库,origin是远程库名
git push origin --tags # 推送所有标签到远程库

删除标签

bash 复制代码
git tag -d v2.0 # 只删除标签,不删除commit
git push origin -d v2.0 # 删除远程库标签

创建发行版

在github/gitee上选择到对应的标签,根据提示操作即可

相关推荐
深海鱼在掘金2 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc3 天前
关于Git Flow
git
蜜獾云3 天前
在Git中配置用户名和密码
git
scx_link3 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
南大白3 天前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
码农小旋风3 天前
Claude Code 基础用法大全:对话、分析、修改、测试、Git 和工作流
人工智能·git·chatgpt·claude
南大白3 天前
Git 撤回提交完整方案
git
像风一样的男人@3 天前
python --实现代理服务器
git·ui
sbjdhjd3 天前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
码云数智-大飞3 天前
Go Channel 详解:并发通信的正确姿势
前端·数据库·git