【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> 
相关推荐
AIMath~15 小时前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~19 小时前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星830357719 小时前
【Git】原理及使用(二) (版本回退)
linux·git
愿天垂怜19 小时前
【C++脚手架】ffmpeg 库的介绍与使用
linux·服务器·开发语言·c++·ide·git·ffmpeg
月夜的风吹雨20 小时前
Linux 基础开发工具详解:从 yum 到 gdb 实战指南
linux·git·ubuntu·centos·vim
好运yoo20 小时前
git cherry-pick
git
不是光头 强21 小时前
Obsidian Git 插件安装与配置完全指南
git
.千余21 小时前
【C++】C++核心语法:函数重载与缺省参数原理与避坑
c语言·开发语言·c++·经验分享·笔记·git·学习
meowrain21 小时前
Git HTTPS Token 凭据配置指南
git·网络协议·https
Ws_1 天前
Git + Gerrit 第二课:diff、暂存区与撤销修改
git