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