6 git-pack-refs - Pack heads and tags for efficient repository access
11 'git pack-refs' [--all] [--no-prune]
16 Traditionally, tips of branches and tags (collectively known as
17 'refs') were stored one file per ref in a (sub)directory
19 directory. While many branch tips tend to be updated often,
20 most tags and some branch tips are never updated. When a
21 repository has hundreds or thousands of tags, this
22 one-file-per-ref format both wastes storage and hurts
25 This command is used to solve the storage and performance
26 problem by storing the refs in a single file,
27 `$GIT_DIR/packed-refs`. When a ref is missing from the
28 traditional `$GIT_DIR/refs` directory hierarchy, it is looked
30 file and used if found.
32 Subsequent updates to branches always create new files under
33 `$GIT_DIR/refs` directory hierarchy.
35 A recommended practice to deal with a repository with too many
36 refs is to pack its refs with `--all` once, and
37 occasionally run `git pack-refs`. Tags are by
38 definition stationary and are not expected to change. Branch
39 heads will be packed with the initial `pack-refs --all`, but
40 only the currently active branch heads will become unpacked,
41 and the next `pack-refs` (without `--all`) will leave them
50 The command by default packs all tags and refs that are already
51 packed, and leaves other refs
52 alone. This is because branches are expected to be actively
53 developed and packing their tips does not help performance.
54 This option causes branch tips to be packed as well. Useful for
55 a repository with many branches of historical interests.
59 The command usually removes loose refs under `$GIT_DIR/refs`
60 hierarchy after packing them. This option tells it not to.
66 Older documentation written before the packed-refs mechanism was
67 introduced may still say things like ".git/refs/heads/<branch> file
68 exists" when it means "branch <branch> exists".
73 Part of the linkgit:git[1] suite