【Git】-- 标签管理

【Git】-- 标签管理

文章目录

更多Git相关知识: Git专栏

1. 标签管理

1.1 标签的作用

标签tag,可以简单的理解为是对某次commit 的一个标识,相当于起了一个别名。例如,在项目发布某个版本的时候,针对最后一次commit 起一个v1.0 这样的标签来标识里程碑的意义。

这有什么用呢?相较于难以记住的 commit id,tag 很好的解决这个问题,因为 tag 一定要给一个让人容易记住,且有意义的名字。当我们需要回退到某个重要版本时,直接使用标签就能很快定位到。

1.2 操作标签

打标签是针对提交打的标签。

1.3 创建标签

该操作会默认给我们最新的依次提交打上v1.0的标签。

root@VM-0-3-ubuntu:~/remote-gitcode# git tag v1.0

1.4 查看有哪些标签

root@VM-0-3-ubuntu:~/remote-gitcode# git tag v1.0 

或者

root@VM-0-3-ubuntu:~/remote-gitcode# tree .git .git ├── branches ├── COMMIT_EDITMSG ├── config ├── description ├── FETCH_HEAD ├── HEAD ├── hooks │ ├── applypatch-msg.sample │ ├── commit-msg.sample │ ├── fsmonitor-watchman.sample │ ├── post-update.sample │ ├── pre-applypatch.sample │ ├── pre-commit.sample │ ├── pre-merge-commit.sample │ ├── prepare-commit-msg.sample │ ├── pre-push.sample │ ├── pre-rebase.sample │ ├── pre-receive.sample │ ├── push-to-checkout.sample │ ├── sendemail-validate.sample │ └── update.sample ├── index ├── info │ └── exclude ├── logs │ ├── HEAD │ └── refs │ ├── heads │ │ └── master │ └── remotes │ └── origin │ ├── HEAD │ ├── master │ └── mater ├── objects │ ├── 05 │ │ └── fe86c3cd7ec2287a059a43b68cdc45f79cc43b │ ├── 09 │ │ └── 9c367d45aa723611f3721038110dc2c7a9eecf │ ├── 13 │ │ └── b46fa6ad76bb659f965fd48c86ed49842aecc3 │ ├── 30 │ │ └── 0659b8f65f8f6ca9160b7154a62c06359772f8 │ ├── 3f │ │ └── 14f45e2fbcd94d370f0a2b0d1ef194ac8c69c5 │ ├── 45 │ │ └── 23b2b9da80d0b335e1652f6070b4de1568b906 │ ├── 4b │ │ └── c8161e604f7e008eacccfdcae36171e119d1e9 │ ├── 8d │ │ └── 0e41234f24b6da002d962a26c2495ea16a425f │ ├── a5 │ │ └── 421d46e76e71c849d56ef0dfd2c64433a2e553 │ ├── f4 │ │ └── 179bfa0f591af2b60a933413a0fd0499dc3ba1 │ ├── info │ └── pack │ ├── pack-c20b9d41255e962915ba1d4372cfe6478f7ec66e.idx │ ├── pack-c20b9d41255e962915ba1d4372cfe6478f7ec66e.pack │ └── pack-c20b9d41255e962915ba1d4372cfe6478f7ec66e.rev ├── ORIG_HEAD ├── packed-refs └── refs ├── heads │ └── master ├── remotes │ └── origin │ ├── HEAD │ ├── master │ └── mater └── tags └── v1.0 
在这里插入图片描述

1.5 查看标签中存放的是什么

root@VM-0-3-ubuntu:~/remote-gitcode# cat .git/refs/tags/v1.0 099c367d45aa723611f3721038110dc2c7a9eecf 

查看提交日志:

root@VM-0-3-ubuntu:~/remote-gitcode# git log commit 099c367d45aa723611f3721038110dc2c7a9eecf (HEAD -> master, tag: v1.0, origin/master, origin/HEAD) Author: pepper-cloth <[email protected]> Date: Mon Jan 1213:34:23 2026 +0800 add .git ignore commit 300659b8f65f8f6ca9160b7154a62c06359772f8 Author: cuckoo <[email protected]> Date: Mon Jan 12 05:14:43 2026 +0000 update file.txt. Signed-off-by: cuckoo <[email protected]>....... 

可以看到,v1.0标签里卖弄存放的就是最后一次提交的commit id。

1.6 给前面的提交打标签

给前面的提交打标签,需要拿到前面提交的commit id。

获取前面提交的commit id:

root@VM-0-3-ubuntu:~/remote-gitcode# git log --pretty=oneline --abbrev-commit 099c367 (HEAD -> master, tag: v1.0, origin/master, origin/HEAD)add .git ignore 300659b update file.txt. f4179bf (origin/mater)add file.txt f59a47a Initial commit 

打标签:

root@VM-0-3-ubuntu:~/remote-gitcode# git tag v0.9 300659b root@VM-0-3-ubuntu:~/remote-gitcode# git tag v0.9 v1.0 

1.7 给标签添加描述

root@VM-0-3-ubuntu:~/remote-gitcode# git tag -a v0.8 -m "important tag: xxx" f4179bf root@VM-0-3-ubuntu:~/remote-gitcode# git tag v0.8 v0.9 v1.0 root@VM-0-3-ubuntu:~/remote-gitcode# git show v0.8 tag v0.8 Tagger: pepper-cloth <[email protected]> Date: Mon Jan 1220:35:09 2026 +0800 important tag: xxx commit f4179bfa0f591af2b60a933413a0fd0499dc3ba1 (tag: v0.8, origin/mater) Author: pepper-cloth <[email protected]> Date: Mon Jan 1213:05:24 2026 +0800 add file.txt diff --git a/file.txt b/file.txt new file mode 100644 index 0000000..8d0e412 --- /dev/null +++ b/file.txt @@ -0,0 +1 @@ +hello git

1.8 删除标签

root@VM-0-3-ubuntu:~/remote-gitcode# git tag -d v0.9 Deleted tag 'v0.9'(was 300659b) root@VM-0-3-ubuntu:~/remote-gitcode# git tag v0.8 v1.0 

1.3 推送标签

1.3.1 单个标签推送

root@VM-0-3-ubuntu:~/remote-gitcode# git push origin v1.0 Total 0(delta 0), reused 0(delta 0), pack-reused 0 remote: Powered by GITEE.COM [1.1.23] remote: Set trace flag f3477ba6 To gitee.com:pepper-cloth/remote-gitcode.git * [new tag] v1.0 -> v1.0 
在这里插入图片描述

1.3.2 多个标签推送

root@VM-0-3-ubuntu:~/remote-gitcode# git push origin --tags Enumerating objects: 1, done. Counting objects: 100% (1/1), done. Writing objects: 100% (1/1), 166 bytes |166.00 KiB/s, done. Total 1(delta 0), reused 0(delta 0), pack-reused 0 remote: Powered by GITEE.COM [1.1.23] remote: Set trace flag 9440c2a3 To gitee.com:pepper-cloth/remote-gitcode.git * [new tag] v0.8 -> v0.8 
在这里插入图片描述

1.3.3 删除标签并推送

root@VM-0-3-ubuntu:~/remote-gitcode# git push origin :v1.0 remote: Powered by GITEE.COM [1.1.23] remote: Set trace flag ac4ae0a3 To gitee.com:pepper-cloth/remote-gitcode.git - [deleted] v1.0 root@VM-0-3-ubuntu:~/remote-gitcode# git tag v0.8 

Read more

在Ubuntu上安装OpenClaw主要有两种主流且官方推荐的方式:一键脚本安装(适合新手和快速部署)和 Docker 安装(适合需要环境隔离和生产环境部署)

在Ubuntu上安装OpenClaw主要有两种主流且官方推荐的方式:一键脚本安装(适合新手和快速部署)和 Docker 安装(适合需要环境隔离和生产环境部署)。此外,对于开发者或需要特定版本的用户,也可以选择从源码安装。 以下是针对Ubuntu系统的详细操作步骤分解。 ⚙️ 第一步:系统准备与依赖安装 在开始之前,需要确保你的Ubuntu系统(建议使用22.04或24.04 LTS版本)已经准备好必要的工具。 1. 打开终端。 安装基础工具链:安装后续步骤中可能用到的curl、git等工具。 sudoaptinstall-ycurlwgetgit build-essential 更新系统包:这是为了避免因系统包过旧而导致的依赖冲突。 sudoapt update &&sudoapt upgrade -y 🚀 第二步:选择并执行安装方法 你可以根据自身需求,从以下三种方法中选择一种进行安装。 方法一:一键脚本安装(最推荐) 这是官方推荐的最简单、最省心的方式。脚本会自动处理Node.js依赖的检测和安装,并直接启动配置向导。 curl-fsSL htt

By Ne0inhk
VMware+Ubuntu+ROS完整部署流程

VMware+Ubuntu+ROS完整部署流程

本文是自己整理的完整的部署ROS的流程,欢迎大家沟通与交流,才疏学浅,有不对的地方欢迎大家与我交流。 注:本文章只适合Windows电脑用户 1.下载需要用到的资料 首先下载虚拟机软件VMware,win10系统选择下载1,win11系统选择下载2,以下是我自己的百度网盘链接: 下载1: 链接:https://pan.baidu.com/s/1d9lAB3OH2LkbmXXNXTmI3A? 提取码:pwd=6cdm 下载2: 链接:https://pan.baidu.com/s/1cgU_tzzkaOaPML0VMbisrA?pwd=m7vs 提取码: m7vs 然后根据你想学习的内容,选择你要下载的Ubuntu镜像,链接对应的镜像版本以及镜像可安装的ROS版本如下: 链接1:(Ubuntu18.04+ros1+melodic) 链接:https://pan.baidu.com/s/

By Ne0inhk
Flutter 组件 image_size_getter_http_input 的鸿蒙化适配实战 - 驾驭极致图像采样大坝、实现 OpenHarmony 高性能列表滚动与流式渲染指纹预检方案

Flutter 组件 image_size_getter_http_input 的鸿蒙化适配实战 - 驾驭极致图像采样大坝、实现 OpenHarmony 高性能列表滚动与流式渲染指纹预检方案

欢迎加入开源鸿蒙跨平台社区:https://openharmonycrossplatform.ZEEKLOG.net Flutter 组件 image_size_getter_http_input 的鸿蒙化适配实战 - 驾驭极致图像采样大坝、实现 OpenHarmony 高性能列表滚动与流式渲染指纹预检方案 前言 在鸿蒙(OpenHarmony)生态的重型电商应用、短视频流媒体或者任何涉及海量瀑布流展示的 0308 批次项目中。“图像渲染的即时感与列表滚动丝滑度维度”是衡量整个前端交互体验的最终质量门禁。面对包含数千张高分辨率商品图、动态变化的社交媒体封面、甚至是跨设备同步产生的超大素材包。如果仅仅依靠传统的“全量下载后再获取尺寸”或者干瘪的占位图策略。不仅会导致在列表快速滚动时因为频繁的布局重绘(Relayout)产生严重的卡顿。更会因为内存溢出(OOM)的风险,让老旧机型在处理图像海啸时瞬间崩溃。 我们需要一种“只读头部、先知大小”的极速采样艺术。 image_size_getter_http_input 是一套专注于无缝整合

By Ne0inhk
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程

在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程

在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程 什么是 OpenClaw?—— 你的本地 AI 智能体执行框架 OpenClaw 不仅仅是一个聊天机器人,而是一个功能强大的 AI 智能体执行框架。你可以把它想象成一个能自主思考、调用工具、并替你完成复杂任务的数字员工。 🧠 核心概念 * 智能体:OpenClaw 的核心大脑。它能理解你的自然语言指令,拆解任务,并决定调用哪些工具来执行。 * 网关:所有外部访问的入口。它负责处理 WebSocket 连接、管理设备配对、路由消息,是你与智能体交互的桥梁。 * 技能:智能体可调用的具体工具,比如访问文件、操作浏览器、发送消息、查询数据库等。你可以根据需要扩展技能库。 * 记忆:OpenClaw 可以存储对话历史和重要信息,实现长期记忆和上下文理解,让交互更连贯。 * 通道:连接外部聊天平台的渠道,如

By Ne0inhk