简体中文 ▾
Localized versions of git-pack-refs manual
Topics ▾
Email
Latest version
▾
git-pack-refs last updated in 2.52.0
Changes in the git-pack-refs manual
Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
-
2.52.0
2025-11-17
- 2.51.1 → 2.51.2 no changes
-
2.51.0
2025-08-18
- 2.50.1 no changes
-
2.50.0
2025-06-16
- 2.45.1 → 2.49.1 no changes
-
2.45.0
2024-04-29
- 2.42.1 → 2.44.4 no changes
-
2.42.0
2023-08-21
- 2.1.4 → 2.41.3 no changes
-
2.0.5
2014-12-17
描述
传统上,分支和标签的提示(统称为 refs)是在 $GIT_DIR/refs 目录下的一个(子)目录中,为每个引用储存一个文件。 虽然许多分支的提示经常被更新,但大多数标签和一些分支的提示从未被更新。 当一个仓库库有成百上千的标签时,这种每个引用一个文件的格式既浪费了存储空间,又损害了性能。
这个命令是用来解决存储和性能问题的,将引用存储在一个文件中,$GIT_DIR/packed-refs。 当传统的 `$GIT_DIR/refs`目录层次中缺少一个引用时,就在这个文件中查找,如果找到就使用。
分支的后续更新总是在 $GIT_DIR/refs 目录层次下创建新文件。
处理一个有太多引用的仓库的推荐做法是,用 --all 来打包它的引用一次,然后偶尔运行 git pack-refs 。 根据定义,标签是固定的,不应该改变。 分支头会被初始的 pack-refs --all 打包,但只有当前活动的分支头会被解压,下一次 pack-refs(没有 --all)会让它们被解压。
GIT
属于 git[1] 文档