blob: 1ee99c208ce4893d2fa2367544b22ed0c8b18044 [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 Hamanofce7c7e2008-07-02 03:06:3810'git pack-refs' [--all] [--no-prune]
Junio C Hamanod8c9d432006-11-07 07:19:1311
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
Junio C Hamanoa6499d72009-04-05 09:18:1729Subsequent updates to branches always create new files under
Junio C Hamanod8c9d432006-11-07 07:19:1330`$GIT_DIR/refs` hierarchy.
31
Junio C Hamano42b78672007-01-26 09:44:5132A recommended practice to deal with a repository with too many
33refs is to pack its refs with `--all --prune` once, and
Junio C Hamanofce7c7e2008-07-02 03:06:3834occasionally run `git pack-refs \--prune`. Tags are by
Junio C Hamano42b78672007-01-26 09:44:5135definition 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,
Junio C Hamanoa6499d72009-04-05 09:18:1738and the next `pack-refs` (without `--all`) will leave them
Junio C Hamano42b78672007-01-26 09:44:5139unpacked.
40
41
Junio C Hamanod8c9d432006-11-07 07:19:1342OPTIONS
43-------
44
Junio C Hamanoeb415992008-06-08 22:49:4745--all::
Junio C Hamanod8c9d432006-11-07 07:19:1346
Junio C Hamano42b78672007-01-26 09:44:5147The command by default packs all tags and refs that are already
48packed, and leaves other refs
Junio C Hamanod8c9d432006-11-07 07:19:1349alone. 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
Junio C Hamanoeb415992008-06-08 22:49:4754--no-prune::
Junio C Hamanod8c9d432006-11-07 07:19:1355
Junio C Hamano1d3a6c72007-01-09 11:13:4756The command usually removes loose refs under `$GIT_DIR/refs`
57hierarchy after packing them. This option tells it not to.
58
Junio C Hamanod8c9d432006-11-07 07:19:1359
60Author
61------
62Written by Linus Torvalds <torvalds@osdl.org>
63
64GIT
65---
Junio C Hamanof7c042d2008-06-06 22:50:5366Part of the linkgit:git[1] suite