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

相关推荐
Ws_5 小时前
Git + Gerrit 第二课:diff、暂存区与撤销修改
git
snowjlz6 小时前
鸿蒙版SVN来了!!!
git·svn·版本控制
2401_876964138 小时前
27考研余炳森概率论|喻老李良2027资料网课
windows·git·考研·svn·eclipse·github·概率论
爱搬砖的狮子8 小时前
【Git】git repo下载使用
git
cheems952712 小时前
Git基本操作
git
Irissgwe12 小时前
三、Git 文件状态管理:add、commit、status 和 diff
git
Ws_16 小时前
Git + Gerrit 第三课:分支、切换与合并
git·elasticsearch
xlq2232217 小时前
6.git
git
Drache_long17 小时前
Git命令概述
git
console.log('npc')17 小时前
修改git中commit内容
git