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

相关推荐
木下~learning11 分钟前
零基础Git入门:Linux+Gitee实战指南
linux·git·gitee·github·虚拟机·版本控制·ubunt
zh_xuan26 分钟前
修改远程仓库名以及和本地工程同步
git
读书札记20221 小时前
Git 配置用户名和邮箱 解决 fatal: unable to auto-detect email address 问题
git
程序员 沐阳2 小时前
Git 二分法精准定位 Bug:从原理到实战,让调试效率起飞
git·elasticsearch·bug
陳10302 小时前
Linux:入门开发工具--Git和GUN调试器
linux·运维·git
淼淼爱喝水2 小时前
Ansible 常用文件模块详解(copy、file、fetch)
chrome·git·github
wdfk_prog3 小时前
解决 Linux 使用符号链接的 Git 仓库在 Windows 下无法创建符号链接的问题
linux·windows·git
一个行走的民3 小时前
git commit 常见类型
git
Rabbit_QL3 小时前
【Git基础】02——分支:在不破坏主线的情况下做实验
大数据·git·elasticsearch
冰凉小脚3 小时前
git查询时间范围内的修改提交文件
git