Update git documentation
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-pack-refs.xml
blobeeb2a6aeab695c5283479c8a692921616c17dc44
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <sect2 lang="en" id="git-pack-refs(1)">\r
5     <title>git-pack-refs(1)</title>\r
6 <indexterm>\r
7 <primary>git-pack-refs(1)</primary>\r
8 </indexterm>\r
9 <simplesect id="git-pack-refs(1)__name">\r
10 <title>NAME</title>\r
11 <simpara>git-pack-refs - Pack heads and tags for efficient repository access</simpara>\r
12 </simplesect>\r
13 <simplesect id="git-pack-refs(1)__synopsis">\r
14 <title>SYNOPSIS</title>\r
15 <blockquote>\r
16 <literallayout><emphasis>git pack-refs</emphasis> [--all] [--no-prune]</literallayout>\r
17 </blockquote>\r
18 </simplesect>\r
19 <simplesect id="git-pack-refs(1)__description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>Traditionally, tips of branches and tags (collectively known as\r
22 <emphasis>refs</emphasis>) were stored one file per ref in a (sub)directory\r
23 under <emphasis>$GIT_DIR/refs</emphasis>\r
24 directory.  While many branch tips tend to be updated often,\r
25 most tags and some branch tips are never updated.  When a\r
26 repository has hundreds or thousands of tags, this\r
27 one-file-per-ref format both wastes storage and hurts\r
28 performance.</simpara>\r
29 <simpara>This command is used to solve the storage and performance\r
30 problem by storing the refs in a single file,\r
31 <emphasis>$GIT_DIR/packed-refs</emphasis>.  When a ref is missing from the\r
32 traditional <emphasis>$GIT_DIR/refs</emphasis> directory hierarchy, it is looked\r
33 up in this\r
34 file and used if found.</simpara>\r
35 <simpara>Subsequent updates to branches always create new files under\r
36 <emphasis>$GIT_DIR/refs</emphasis> directory hierarchy.</simpara>\r
37 <simpara>A recommended practice to deal with a repository with too many\r
38 refs is to pack its refs with <emphasis>--all</emphasis> once, and\r
39 occasionally run <emphasis>git pack-refs</emphasis>.  Tags are by\r
40 definition stationary and are not expected to change.  Branch\r
41 heads will be packed with the initial <emphasis>pack-refs --all</emphasis>, but\r
42 only the currently active branch heads will become unpacked,\r
43 and the next <emphasis>pack-refs</emphasis> (without <emphasis>--all</emphasis>) will leave them\r
44 unpacked.</simpara>\r
45 </simplesect>\r
46 <simplesect id="git-pack-refs(1)__options">\r
47 <title>OPTIONS</title>\r
48 <variablelist>\r
49 <varlistentry>\r
50 <term>\r
51 --all\r
52 </term>\r
53 <listitem>\r
54 <simpara>\r
55 The command by default packs all tags and refs that are already\r
56 packed, and leaves other refs\r
57 alone.  This is because branches are expected to be actively\r
58 developed and packing their tips does not help performance.\r
59 This option causes branch tips to be packed as well.  Useful for\r
60 a repository with many branches of historical interests.\r
61 </simpara>\r
62 </listitem>\r
63 </varlistentry>\r
64 <varlistentry>\r
65 <term>\r
66 --no-prune\r
67 </term>\r
68 <listitem>\r
69 <simpara>\r
70 The command usually removes loose refs under <emphasis>$GIT_DIR/refs</emphasis>\r
71 hierarchy after packing them.  This option tells it not to.\r
72 </simpara>\r
73 </listitem>\r
74 </varlistentry>\r
75 </variablelist>\r
76 </simplesect>\r
77 <simplesect id="git-pack-refs(1)__bugs">\r
78 <title>BUGS</title>\r
79 <simpara>Older documentation written before the packed-refs mechanism was\r
80 introduced may still say things like ".git/refs/heads/&lt;branch&gt; file\r
81 exists" when it means "branch &lt;branch&gt; exists".</simpara>\r
82 </simplesect>\r
83 <simplesect id="git-pack-refs(1)__git">\r
84 <title>GIT</title>\r
85 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
86 </simplesect>\r
87 </sect2>\r