blob: a3c6677bfaaf628410eb85ce06f58d3c2b4df966 [file] [log] [blame]
Junio C Hamanod8c9d432006-11-07 07:19:131git-pack-refs(1)
2================
3
4NAME
5----
6git-pack-refs - Pack heads and tags for efficient repository access
7
8SYNOPSIS
9--------
Junio C Hamano15567bc2011-07-23 00:51:5910[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3811'git pack-refs' [--all] [--no-prune]
Junio C Hamanod8c9d432006-11-07 07:19:1312
13DESCRIPTION
14-----------
15
16Traditionally, tips of branches and tags (collectively known as
17'refs') were stored one file per ref under `$GIT_DIR/refs`
18directory. While many branch tips tend to be updated often,
19most tags and some branch tips are never updated. When a
20repository has hundreds or thousands of tags, this
21one-file-per-ref format both wastes storage and hurts
22performance.
23
24This command is used to solve the storage and performance
25problem by stashing the refs in a single file,
26`$GIT_DIR/packed-refs`. When a ref is missing from the
27traditional `$GIT_DIR/refs` hierarchy, it is looked up in this
28file and used if found.
29
Junio C Hamanoa6499d72009-04-05 09:18:1730Subsequent updates to branches always create new files under
Junio C Hamanod8c9d432006-11-07 07:19:1331`$GIT_DIR/refs` hierarchy.
32
Junio C Hamano42b78672007-01-26 09:44:5133A recommended practice to deal with a repository with too many
34refs is to pack its refs with `--all --prune` once, and
Junio C Hamanofce7c7e2008-07-02 03:06:3835occasionally run `git pack-refs \--prune`. Tags are by
Junio C Hamano42b78672007-01-26 09:44:5136definition stationary and are not expected to change. Branch
37heads will be packed with the initial `pack-refs --all`, but
38only the currently active branch heads will become unpacked,
Junio C Hamanoa6499d72009-04-05 09:18:1739and the next `pack-refs` (without `--all`) will leave them
Junio C Hamano42b78672007-01-26 09:44:5140unpacked.
41
42
Junio C Hamanod8c9d432006-11-07 07:19:1343OPTIONS
44-------
45
Junio C Hamanoeb415992008-06-08 22:49:4746--all::
Junio C Hamanod8c9d432006-11-07 07:19:1347
Junio C Hamano42b78672007-01-26 09:44:5148The command by default packs all tags and refs that are already
49packed, and leaves other refs
Junio C Hamanod8c9d432006-11-07 07:19:1350alone. This is because branches are expected to be actively
51developed and packing their tips does not help performance.
52This option causes branch tips to be packed as well. Useful for
53a repository with many branches of historical interests.
54
Junio C Hamanoeb415992008-06-08 22:49:4755--no-prune::
Junio C Hamanod8c9d432006-11-07 07:19:1356
Junio C Hamano1d3a6c72007-01-09 11:13:4757The command usually removes loose refs under `$GIT_DIR/refs`
58hierarchy after packing them. This option tells it not to.
59
Junio C Hamanod8c9d432006-11-07 07:19:1360GIT
61---
Junio C Hamanof7c042d2008-06-06 22:50:5362Part of the linkgit:git[1] suite