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

相关推荐
q54314708725 分钟前
Redis Desktop Manager(Redis可视化工具)安装及使用详细教程
redis·git·bootstrap
素雨迁喜2 小时前
Linux平台下git工具的使用
linux·运维·git
Irene19914 小时前
Windows环境,VS Code 中 Git 配置指南
git·基础配置
Yang-Never5 小时前
AI Code -> Windows电脑安装Claude
开发语言·windows·git
Irene19915 小时前
2026 前端开发 Windows 安装 Git 配置指南(有实际安装过程参考:适配版本 the latest 2.53.0(2) x64 )
前端·windows·git
早起的年轻人5 小时前
告别Git仓库臃肿:一招解决Maven target目录误提交问题
java·git·maven
悠然大月季1 天前
git 怎么导出提交历史,文件是乱码
git·git导出历史记录·git导出历史乱码
chenshiming8021 天前
在cursor下执行GIT回退版本
git
打点计时器1 天前
Git快速上手教程
git
我才是一卓1 天前
linux 安装简易 git 服务端并使用
linux·运维·git