Junio C Hamano | d8c9d43 | 2006-11-07 07:19:13 | [diff] [blame] | 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 | -------- |
Junio C Hamano | 1d3a6c7 | 2007-01-09 11:13:47 | [diff] [blame] | 10 | 'git-pack-refs' [--all] [--no-prune] |
Junio C Hamano | d8c9d43 | 2006-11-07 07:19:13 | [diff] [blame] | 11 | |
| 12 | DESCRIPTION |
| 13 | ----------- |
| 14 | |
| 15 | Traditionally, tips of branches and tags (collectively known as |
| 16 | 'refs') were stored one file per ref under `$GIT_DIR/refs` |
| 17 | directory. While many branch tips tend to be updated often, |
| 18 | most tags and some branch tips are never updated. When a |
| 19 | repository has hundreds or thousands of tags, this |
| 20 | one-file-per-ref format both wastes storage and hurts |
| 21 | performance. |
| 22 | |
| 23 | This command is used to solve the storage and performance |
| 24 | problem by stashing the refs in a single file, |
| 25 | `$GIT_DIR/packed-refs`. When a ref is missing from the |
| 26 | traditional `$GIT_DIR/refs` hierarchy, it is looked up in this |
| 27 | file and used if found. |
| 28 | |
| 29 | Subsequent updates to branches always creates new file under |
| 30 | `$GIT_DIR/refs` hierarchy. |
| 31 | |
Junio C Hamano | 42b7867 | 2007-01-26 09:44:51 | [diff] [blame] | 32 | A recommended practice to deal with a repository with too many |
| 33 | refs is to pack its refs with `--all --prune` once, and |
| 34 | occasionally run `git-pack-refs \--prune`. Tags are by |
| 35 | definition stationary and are not expected to change. Branch |
| 36 | heads will be packed with the initial `pack-refs --all`, but |
| 37 | only the currently active branch heads will become unpacked, |
| 38 | and next `pack-refs` (without `--all`) will leave them |
| 39 | unpacked. |
| 40 | |
| 41 | |
Junio C Hamano | d8c9d43 | 2006-11-07 07:19:13 | [diff] [blame] | 42 | OPTIONS |
| 43 | ------- |
| 44 | |
| 45 | \--all:: |
| 46 | |
Junio C Hamano | 42b7867 | 2007-01-26 09:44:51 | [diff] [blame] | 47 | The command by default packs all tags and refs that are already |
| 48 | packed, and leaves other refs |
Junio C Hamano | d8c9d43 | 2006-11-07 07:19:13 | [diff] [blame] | 49 | alone. This is because branches are expected to be actively |
| 50 | developed and packing their tips does not help performance. |
| 51 | This option causes branch tips to be packed as well. Useful for |
| 52 | a repository with many branches of historical interests. |
| 53 | |
Junio C Hamano | 1d3a6c7 | 2007-01-09 11:13:47 | [diff] [blame] | 54 | \--no-prune:: |
Junio C Hamano | d8c9d43 | 2006-11-07 07:19:13 | [diff] [blame] | 55 | |
Junio C Hamano | 1d3a6c7 | 2007-01-09 11:13:47 | [diff] [blame] | 56 | The command usually removes loose refs under `$GIT_DIR/refs` |
| 57 | hierarchy after packing them. This option tells it not to. |
| 58 | |
Junio C Hamano | d8c9d43 | 2006-11-07 07:19:13 | [diff] [blame] | 59 | |
| 60 | Author |
| 61 | ------ |
| 62 | Written by Linus Torvalds <torvalds@osdl.org> |
| 63 | |
| 64 | GIT |
| 65 | --- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 66 | Part of the linkgit:git[7] suite |