【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> 
相关推荐
Doris_LMS1 天前
Git的强软硬回退(三)
运维·服务器·数据库·git·idea
瓜酷月..1 天前
GIT(了解)
git
misty youth1 天前
git命令常用指南
git·github
持续迷茫1 天前
lint-staged 中 --verbose 选项的深度解析
前端·git
lostElk1 天前
团队 Git 分管理全流程规范
git·github
亦是行人!1 天前
删除git中已经提交的target、logs、.idea文件
git
匆叔2 天前
Git下载全攻略
前端·git
奇树谦2 天前
Git配置:禁用全局HTTPS验证
git·网络协议·https
小安同学iter2 天前
在idea当中git的基础使用
git
初级代码游戏2 天前
Git或TortoiseGit的小BUG(可解决):空库报错Could not get hash of ““
git·bug