]>
Commit | Line | Data |
---|---|---|
d28f7cb9 JH |
1 | git-pack-refs(1) |
2 | ================ | |
3 | ||
4 | NAME | |
5 | ---- | |
6 | git-pack-refs - Pack heads and tags for efficient repository access | |
7 | ||
8 | SYNOPSIS | |
9 | -------- | |
7791a1d9 | 10 | [verse] |
b1889c36 | 11 | 'git pack-refs' [--all] [--no-prune] |
d28f7cb9 JH |
12 | |
13 | DESCRIPTION | |
14 | ----------- | |
15 | ||
16 | Traditionally, tips of branches and tags (collectively known as | |
17 | 'refs') were stored one file per ref under `$GIT_DIR/refs` | |
18 | directory. While many branch tips tend to be updated often, | |
19 | most tags and some branch tips are never updated. When a | |
20 | repository has hundreds or thousands of tags, this | |
21 | one-file-per-ref format both wastes storage and hurts | |
22 | performance. | |
23 | ||
24 | This command is used to solve the storage and performance | |
25 | problem by stashing the refs in a single file, | |
26 | `$GIT_DIR/packed-refs`. When a ref is missing from the | |
27 | traditional `$GIT_DIR/refs` hierarchy, it is looked up in this | |
28 | file and used if found. | |
29 | ||
38b7ccbe | 30 | Subsequent updates to branches always create new files under |
d28f7cb9 JH |
31 | `$GIT_DIR/refs` hierarchy. |
32 | ||
af67e91c JH |
33 | A recommended practice to deal with a repository with too many |
34 | refs is to pack its refs with `--all --prune` once, and | |
b1889c36 | 35 | occasionally run `git pack-refs \--prune`. Tags are by |
af67e91c JH |
36 | definition stationary and are not expected to change. Branch |
37 | heads will be packed with the initial `pack-refs --all`, but | |
38 | only the currently active branch heads will become unpacked, | |
38b7ccbe | 39 | and the next `pack-refs` (without `--all`) will leave them |
af67e91c JH |
40 | unpacked. |
41 | ||
42 | ||
d28f7cb9 JH |
43 | OPTIONS |
44 | ------- | |
45 | ||
3240240f | 46 | --all:: |
d28f7cb9 | 47 | |
af67e91c JH |
48 | The command by default packs all tags and refs that are already |
49 | packed, and leaves other refs | |
d28f7cb9 JH |
50 | alone. This is because branches are expected to be actively |
51 | developed and packing their tips does not help performance. | |
52 | This option causes branch tips to be packed as well. Useful for | |
53 | a repository with many branches of historical interests. | |
54 | ||
3240240f | 55 | --no-prune:: |
0f018bab JH |
56 | |
57 | The command usually removes loose refs under `$GIT_DIR/refs` | |
58 | hierarchy after packing them. This option tells it not to. | |
d28f7cb9 | 59 | |
d28f7cb9 JH |
60 | GIT |
61 | --- | |
9e1f0a85 | 62 | Part of the linkgit:git[1] suite |