【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> 
相关推荐
醇氧9 小时前
【git】WARNING: connection is not using a post-quantum key exchange algorithm.
git
一只程序熊10 小时前
Git不常用操作记录
git
小龙11 小时前
【Git 报错解决】 远程仓库 origin 已存在(`remote origin already exists`)
git·报错
BORN(^-^)19 小时前
Git 操作概要
git
bigHead-1 天前
Git合并操作详解:安全高效地合并远程分支
git·安全·elasticsearch
C_心欲无痕1 天前
ts - 交叉类型
前端·git·typescript
秋饼1 天前
【K8S测试程序--git地址】
git·容器·kubernetes
小龙1 天前
【Git 报错解决】本地无有效提交无法推送(`src refspec main does not match any`)
git·github·报错
小扶苏1 天前
删除git全局账号信息并设置成新的账号密码命令
git
Greg_Zhong2 天前
Git创建任务分支进行开发,最后合并主分支master【纯git命令执行过程】阐述
git