1GIT-PACK-REFS(1)                  Git Manual                  GIT-PACK-REFS(1)
2
3
4

NAME

6       git-pack-refs - Pack heads and tags for efficient repository access
7

SYNOPSIS

9       git pack-refs [--all] [--no-prune]
10
11

DESCRIPTION

13       Traditionally, tips of branches and tags (collectively known as refs)
14       were stored one file per ref in a (sub)directory under $GIT_DIR/refs
15       directory. While many branch tips tend to be updated often, most tags
16       and some branch tips are never updated. When a repository has hundreds
17       or thousands of tags, this one-file-per-ref format both wastes storage
18       and hurts performance.
19
20       This command is used to solve the storage and performance problem by
21       storing the refs in a single file, $GIT_DIR/packed-refs. When a ref is
22       missing from the traditional $GIT_DIR/refs directory hierarchy, it is
23       looked up in this file and used if found.
24
25       Subsequent updates to branches always create new files under
26       $GIT_DIR/refs directory hierarchy.
27
28       A recommended practice to deal with a repository with too many refs is
29       to pack its refs with --all once, and occasionally run git pack-refs.
30       Tags are by definition stationary and are not expected to change.
31       Branch heads will be packed with the initial pack-refs --all, but only
32       the currently active branch heads will become unpacked, and the next
33       pack-refs (without --all) will leave them unpacked.
34

OPTIONS

36       --all
37           The command by default packs all tags and refs that are already
38           packed, and leaves other refs alone. This is because branches are
39           expected to be actively developed and packing their tips does not
40           help performance. This option causes branch tips to be packed as
41           well. Useful for a repository with many branches of historical
42           interests.
43
44       --no-prune
45           The command usually removes loose refs under $GIT_DIR/refs
46           hierarchy after packing them. This option tells it not to.
47

BUGS

49       Older documentation written before the packed-refs mechanism was
50       introduced may still say things like ".git/refs/heads/<branch> file
51       exists" when it means "branch <branch> exists".
52

GIT

54       Part of the git(1) suite
55
56
57
58Git 2.20.1                        12/15/2018                  GIT-PACK-REFS(1)
Impressum