Skip to content

标签

一句话解释

标签是 named 指针到 特定提交, 典型地 used 到 mark 发布 versions 如 v1.0.0.

用大白话说

标签是 human-readable name attached 到特定提交, 如 bookmark in history. 标签是 大多数通常 used 到 mark 发布点: v1.0.0, v2.1.3, v1.0-beta.

There are two types of tags: lightweight (just a pointer, like a branch that does not move) and annotated (stores a message, tagger name, email, and date). Annotated tags are recommended for releases because they carry metadata and are GPG-signable.

Unlike branches, tags do not move — they always point to the same commit. Tags are not pushed by default with git 推送; you must explicitly push them with git 推送 原点 <标签> or git 推送 --标签.

示例

bash
# Create an annotated tag
git tag -a v1.0.0 -m "First stable release"

# List all tags
git tag

# Push a specific tag
git push origin v1.0.0

标签 mark 发布点. Annotated 标签 carry metadata.

相关术语

相关资源

相关课程

解读错误信息

用大白话解释常见错误——什么意思、为什么发生、如何修复。

查看错误

← 返回术语表