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

相关推荐
DZSpace38 分钟前
git stash命令用法
git
Vowwwwwww44 分钟前
GIT历史存在大文件的解决办法
前端·git·后端
@BreCaspian1 小时前
Git 推送失败解决教程——error: failed to push some refs to
大数据·git·elasticsearch
该换个名儿了5 小时前
git多个commit合并成一个
前端·git
不爱学英文的码字机器5 小时前
[Git] 分布式版本控制 & 远程仓库协作
分布式·git
Stack_guigui6 小时前
git连接本地仓库以及gitee
git·gitee
火车叼位6 小时前
Git 精准移植代码:cherry-pick 简单说明
前端·git
Cynthia-石头10 小时前
Git Github Gitee GitLab
git·gitee·github
ak啊1 天前
Git 撤销操作完全指南:从工作区到远程仓库的救赎之路
git
小_路1 天前
git 常用命令
git