Git 标签

$ git tag -a v1.0

git tag -a 标签注解,就像提交注解。

执行 git log --decorate 可看我们标签:

复制代码
*   d5e9fc2 (HEAD -> master) Merge branch 'change_site'
|\  
| * 7774248 (change_site) changed the runoob.php
* | c68142b 修改代码
|/  
* c1501a2 removed test.txt、add runoob.php
* 3e92c19 add test.txt
* 3b58100 第一次版本提交

例如,忘打标签,追加标签:

复制代码
$ git tag -a v0.9 85fc7e7
$ git log --oneline --decorate --graph
*   d5e9fc2 (HEAD -> master) Merge branch 'change_site'
|\  
| * 7774248 (change_site) changed the runoob.php
* | c68142b 修改代码
|/  
* c1501a2 removed test.txt、add runoob.php
* 3e92c19 add test.txt
* 3b58100 (tag: v0.9) 第一次版本提交

查看所有标签:

复制代码
$ git tag
v0.9
v1.0

指定标签:

复制代码
git tag -a <tagname> -m "runoob.com标签"

PGP签名标签命令:

复制代码
git tag -s <tagname> -m "runoob.com标签"
相关推荐
zzzzls~6 小时前
Vibe Coding 最佳实践:Claude Code 检查点回溯与 Git 自动存档每轮对话
git·ai·claude·vibe coding·checkpointing
ssshooter7 小时前
彻底搞懂 SSH 与 Git 的“幕后交易”
git·github·全栈
Asurplus11 小时前
Centos7安装Git环境
git·centos·yum·dnf
m0_7431251312 小时前
claude --version 报错Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win).
开发语言·git·bash
AntoineGriezmann13 小时前
Git:新建功能分支并解决 Merge 冲突
git
Sylus_sui15 小时前
Git快速创建并推送新分支
git
悠悠子衿1213816 小时前
Claude+VSCODE配置git导致频繁弹出git bash 的CMO窗口解决方法
ide·git·vscode
QC七哥17 小时前
伪造git提交记录生成点阵字符
git·github
HilariousDog18 小时前
git仓库中克隆文件同时保存line history / 行提交历史的方法介绍
git
TimberWill18 小时前
GitHub Copilot 一键生成中文commit提示语规则设置
git·github