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