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

相关推荐
weixin_462446231 天前
使用 git filter-repo 统一提交作者信息(修复常见逻辑问题)
git
化名三爷1 天前
SSH 公钥设置
git·gitee·ssh·ssh公钥·git公钥
web守墓人1 天前
【git】git基础用法指南
git
小肉包de1 天前
本地项目第一次提交到远程仓库
git
酒书1 天前
mac电脑idea更改git用户名和密码
git·macos·intellij-idea
学好statistics和DS1 天前
.git folder
git
神秘代码行者1 天前
Git Restore 命令教程
大数据·git·elasticsearch
yanlaifan2 天前
git命令删除一个分支中的指定commit
git
m0_471199632 天前
【git】略微解析一下 git cherry-pick 命令
git
wacpguo2 天前
Git 远程公共分支 到 本地个人分支
git