# 用 Git 历史链替代数千个 Release 标签

Original title: Maybe a better way to track the release history of a Git repo

> Hacker News story 50067721 · language: zh · submitted 2026-10-13
> Web version: https://zeli.app/zh/story/50067721
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 36 · by [hellerve](<https://news.ycombinator.com/user?id=hellerve>) · 💬 8
[original](<https://blog.plover.com/prog/git/history-proposal.html>) · [HN discussion](<https://news.ycombinator.com/item?id=50067721>)

## Summary

在 ZipRecruiter 工作期间，我们的 Git monorepo 因部署工具为每次发布创建大量标签而陷入性能泥潭。成千上万个 refs 导致 `git fetch` 和 `git branch` 等日常命令变慢，且标签列表杂乱无章。我提出了一种替代方案：不再为每次发布创建新标签，而是利用 Git 自身的历史机制，将每次发布记录为具有两个父节点的元信息提交（metainfo commit）。这样，每个应用只需一个 ref，通过链表结构即可完整追溯发布历史。这不仅解决了性能瓶颈，还让 `git log` 等原生命令能自然、高效地查询和回滚发布记录，真正实现了在不引入额外负担的前提下记录不可变的审计轨迹。

## Key quote

> 将部署历史存储在仓库中的一个好理由，是使其变得不可变，但标签本身并不是不可变的！

## HN discussion (8 comments)

### [1718627440](<https://news.ycombinator.com/item?id=50080447>)

> 其实你不用想这么多，只要发布时合并到 release 分支，就能得到同样的效果。

### [lijok](<https://news.ycombinator.com/item?id=50079397>)

> 或者往 main 分支提交一个代表发布的文件，然后基于它来构建自动化流程。

### [unsloppable](<https://news.ycombinator.com/item?id=50080370>)

> 很酷，很巧妙。
>
> 有个问题：你们旧标签（refs）是用来干嘛的？
>
> 我们标签太多的时候就直接删了。

---

## Cite

- Page: https://zeli.app/zh/story/50067721
- Date: 2026-10-13
- Source: blog.plover.com (https://blog.plover.com/prog/git/history-proposal.html)
- Hacker News: https://news.ycombinator.com/item?id=50067721

## Other languages

- en: https://zeli.app/story/50067721 · markdown: https://zeli.app/story/50067721.md
- ja: https://zeli.app/ja/story/50067721 · markdown: https://zeli.app/ja/story/50067721.md
- ko: https://zeli.app/ko/story/50067721 · markdown: https://zeli.app/ko/story/50067721.md
- de: https://zeli.app/de/story/50067721 · markdown: https://zeli.app/de/story/50067721.md
- es: https://zeli.app/es/story/50067721 · markdown: https://zeli.app/es/story/50067721.md
- ru: https://zeli.app/ru/story/50067721 · markdown: https://zeli.app/ru/story/50067721.md
