【Git】tag 标签用法

文章目录

基本用法

Git 可以对某一时间点上的版本打上标签。比如在发布某个软件版本的时候( v1.0 等等)

  • 查看tag列表
shell 复制代码
➜ git tag
v0.1
v1.3
  • 搜索tag列表
shell 复制代码
➜ git tag -l 'v1.4.2.*'
v1.4.2.1
v1.4.2.2
v1.4.2.3
v1.4.2.4
  • 显示标签版本信息
shell 复制代码
➜ git show v0.1
  • 创建标签
shell 复制代码
# 创建标签-轻量级标签
➜ git tag -a <tagname> 
# 创建标签-含附注标签
➜ git tag -a <tagname> -m "tag注释" 
  • 推送标签
shell 复制代码
# 推送一个本地标签到远程仓库
➜ git push origin <tagname> 
# 推送全部未推送过的本地标签	
➜ git push origin --tags 		
  • 删除标签
shell 复制代码
# 删除本地标签
➜ git tag -d <tagname> 	
# 删除远程标签
➜ git push origin :refs/tags/<tagname> 
相关推荐
阿凡达蘑菇灯16 小时前
git安装--gitlab操作
git·gitlab
Mo_YuO.o17 小时前
工作区 暂存区 版本库
git·gitee·github
深念Y17 小时前
本地Git仓库推送到Gitee教程
git·gitee·github·仓库·项目·源代码管理·初始化
白云千载尽17 小时前
a800上gazebo无法使用gpu的问题修复
网络·git·github
凯酱21 小时前
git 拉取指定分支
git
Easonmax1 天前
【鸿蒙pc命令行适配】tig(git命令行可视化)工具移植实战:解决ncurses库依赖、terminfo终端适配与环境配置全流程
git·华为·harmonyos
petunsecn1 天前
多 GitHub 账号与多平台 Git 使用(附加场景:就想用指定账号clone)
git·github
yuanmenghao1 天前
Git submodule 与 git-repo(Google 的 repo 工具) 在多仓库管理上的差异
git
木易双人青1 天前
git常用命令
git
热忱11281 天前
Git 全套常用命令手册(含日常开发示例)
大数据·git·elasticsearch·搜索引擎