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	[email protected]:stree_line/test.git (fetch)
origin	[email protected]: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上选择到对应的标签,根据提示操作即可

相关推荐
-曾牛18 分钟前
Git Flow
大数据·git·学习·elasticsearch·个人开发
Zfox_1 小时前
Git 进阶之路:高效协作之分支管理
大数据·linux·运维·c++·git·elasticsearch
小生不才yz1 小时前
23. git reset
git
码农小站2 小时前
开发手记 | IDEA代码Push后回退
git
兔六哥3 小时前
当更改新的 git 仓库地址时,不要着急执行 clone 应该先运行这个
git
weixin-a153003083168 小时前
git常用命令
git
前端小干将10 小时前
开发过程中,git常用命令
git
西柚啊10 小时前
Git常用命令总结
前端·git
云梦谭12 小时前
Git 配置 GPG 提交签名
git·gpg
李艺为15 小时前
Ubuntu下展锐刷机工具spd_dump使用说明
android·linux·git·ubuntu