updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-pack-refs.xml
blob7966763b259338a2c2cbc6f08259db7917e9236f
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-pack-refs(1)">\r
5 <articleinfo>\r
6     <title>git-pack-refs(1)</title>\r
7 <indexterm>\r
8 <primary>git-pack-refs(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-pack-refs - Pack heads and tags for efficient repository access</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git pack-refs</emphasis> [--all] [--no-prune]</literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="_description">\r
22 <title>DESCRIPTION</title>\r
23 <simpara>Traditionally, tips of branches and tags (collectively known as\r
24 <emphasis>refs</emphasis>) were stored one file per ref under <emphasis>$GIT_DIR/refs</emphasis>\r
25 directory.  While many branch tips tend to be updated often,\r
26 most tags and some branch tips are never updated.  When a\r
27 repository has hundreds or thousands of tags, this\r
28 one-file-per-ref format both wastes storage and hurts\r
29 performance.</simpara>\r
30 <simpara>This command is used to solve the storage and performance\r
31 problem by stashing the refs in a single file,\r
32 <emphasis>$GIT_DIR/packed-refs</emphasis>.  When a ref is missing from the\r
33 traditional <emphasis>$GIT_DIR/refs</emphasis> hierarchy, it is looked 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> 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 --prune</emphasis> once, and\r
39 occasionally run <emphasis>git pack-refs --prune</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="_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">\r
78 <title>GIT</title>\r
79 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
80 </simplesect>\r
81 </article>\r