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上选择到对应的标签,根据提示操作即可

相关推荐
-拟墨画扇-3 小时前
Git | 分支管理操作
git·gitee·github·gitcode
ModestCoder_3 小时前
Git 版本管理教程
大数据·git·elasticsearch
YMGogre3 小时前
Git 提交信息规范
git
charlie1145141914 小时前
Git团队协作完全入门指南(下)
git
golang学习记6 小时前
Facebook 为什么不用 Git?
git·elasticsearch·facebook
GIS阵地7 小时前
git拉取时报错
大数据·git·elasticsearch
charlee448 小时前
CMake构建学习笔记32-CMake版本切换
cmake·版本管理·构建·update·alternatives
无限进步_9 小时前
C++ Vector 全解析:从使用到深入理解
开发语言·c++·ide·windows·git·github·visual studio
charlee4410 小时前
Git使用经验总结9-Git提交关联到Issue
git·issue
-拟墨画扇-10 小时前
Git | Bug分支操作
git·gitee·github·bug·gitcode