Update Tortoise.pot
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-pack-refs.xml
blob785970aa1c7bfe402675ba1435282ea74fc83f2d
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">\r
3 \r
4 <sect2 lang="en" id="git-pack-refs(1)">\r
5     <title>git-pack-refs(1)</title>\r
6     <date>2023-11-02</date>\r
7 <revhistory><revision><date>2023-11-02</date></revision></revhistory>\r
8 <indexterm>\r
9 <primary>git-pack-refs(1)</primary>\r
10 </indexterm>\r
11 <simplesect id="git-pack-refs(1)__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="git-pack-refs(1)__synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git pack-refs</emphasis> [--all] [--no-prune] [--include &lt;pattern&gt;] [--exclude &lt;pattern&gt;]</literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="git-pack-refs(1)__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 in a (sub)directory\r
25 under <emphasis>$GIT_DIR/refs</emphasis>\r
26 directory.  While many branch tips tend to be updated often,\r
27 most tags and some branch tips are never updated.  When a\r
28 repository has hundreds or thousands of tags, this\r
29 one-file-per-ref format both wastes storage and hurts\r
30 performance.</simpara>\r
31 <simpara>This command is used to solve the storage and performance\r
32 problem by storing the refs in a single file,\r
33 <emphasis>$GIT_DIR/packed-refs</emphasis>.  When a ref is missing from the\r
34 traditional <emphasis>$GIT_DIR/refs</emphasis> directory hierarchy, it is looked\r
35 up in this\r
36 file and used if found.</simpara>\r
37 <simpara>Subsequent updates to branches always create new files under\r
38 <emphasis>$GIT_DIR/refs</emphasis> directory hierarchy.</simpara>\r
39 <simpara>A recommended practice to deal with a repository with too many\r
40 refs is to pack its refs with <emphasis>--all</emphasis> once, and\r
41 occasionally run <emphasis>git pack-refs</emphasis>.  Tags are by\r
42 definition stationary and are not expected to change.  Branch\r
43 heads will be packed with the initial <emphasis>pack-refs --all</emphasis>, but\r
44 only the currently active branch heads will become unpacked,\r
45 and the next <emphasis>pack-refs</emphasis> (without <emphasis>--all</emphasis>) will leave them\r
46 unpacked.</simpara>\r
47 </simplesect>\r
48 <simplesect id="git-pack-refs(1)__options">\r
49 <title>OPTIONS</title>\r
50 <variablelist>\r
51 <varlistentry>\r
52 <term>\r
53 --all\r
54 </term>\r
55 <listitem>\r
56 <simpara>\r
57 The command by default packs all tags and refs that are already\r
58 packed, and leaves other refs\r
59 alone.  This is because branches are expected to be actively\r
60 developed and packing their tips does not help performance.\r
61 This option causes all refs to be packed as well, with the exception\r
62 of hidden refs, broken refs, and symbolic refs. Useful for a repository\r
63 with many branches of historical interests.\r
64 </simpara>\r
65 </listitem>\r
66 </varlistentry>\r
67 <varlistentry>\r
68 <term>\r
69 --no-prune\r
70 </term>\r
71 <listitem>\r
72 <simpara>\r
73 The command usually removes loose refs under <emphasis>$GIT_DIR/refs</emphasis>\r
74 hierarchy after packing them.  This option tells it not to.\r
75 </simpara>\r
76 </listitem>\r
77 </varlistentry>\r
78 <varlistentry>\r
79 <term>\r
80 --include &lt;pattern&gt;\r
81 </term>\r
82 <listitem>\r
83 <simpara>\r
84 Pack refs based on a <emphasis>glob(7)</emphasis> pattern. Repetitions of this option\r
85 accumulate inclusion patterns. If a ref is both included in <emphasis>--include</emphasis> and\r
86 <emphasis>--exclude</emphasis>, <emphasis>--exclude</emphasis> takes precedence. Using <emphasis>--include</emphasis> will preclude all\r
87 tags from being included by default. Symbolic refs and broken refs will never\r
88 be packed. When used with <emphasis>--all</emphasis>, it will be a noop. Use <emphasis>--no-include</emphasis> to clear\r
89 and reset the list of patterns.\r
90 </simpara>\r
91 </listitem>\r
92 </varlistentry>\r
93 <varlistentry>\r
94 <term>\r
95 --exclude &lt;pattern&gt;\r
96 </term>\r
97 <listitem>\r
98 <simpara>\r
99 Do not pack refs matching the given <emphasis>glob(7)</emphasis> pattern. Repetitions of this option\r
100 accumulate exclusion patterns. Use <emphasis>--no-exclude</emphasis> to clear and reset the list of\r
101 patterns. If a ref is already packed, including it with <emphasis>--exclude</emphasis> will not\r
102 unpack it.\r
103 </simpara>\r
104 </listitem>\r
105 </varlistentry>\r
106 </variablelist>\r
107 <simpara>When used with <emphasis>--all</emphasis>, pack only loose refs which do not match any of\r
108 the provided <emphasis>--exclude</emphasis> patterns.</simpara>\r
109 <simpara>When used with <emphasis>--include</emphasis>, refs provided to <emphasis>--include</emphasis>, minus refs that are\r
110 provided to <emphasis>--exclude</emphasis> will be packed.</simpara>\r
111 </simplesect>\r
112 <simplesect id="git-pack-refs(1)__bugs">\r
113 <title>BUGS</title>\r
114 <simpara>Older documentation written before the packed-refs mechanism was\r
115 introduced may still say things like ".git/refs/heads/&lt;branch&gt; file\r
116 exists" when it means "branch &lt;branch&gt; exists".</simpara>\r
117 </simplesect>\r
118 <simplesect id="git-pack-refs(1)__git">\r
119 <title>GIT</title>\r
120 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
121 </simplesect>\r
122 </sect2>\r