2 .\" Copyright (c) 2021 Stefan Sperling
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 .Nd Game of Trees repository administration
29 is the repository maintenance tool for the
31 version control system.
34 stores the history of tracked files in a Git repository, as used
35 by the Git version control system.
37 provides commands for inspecting and manipulating the on-disk state of
39 The repository format is described in
40 .Xr git-repository 5 .
43 provides global and command-specific options.
44 Global options must precede the command name, and are as follows:
45 .Bl -tag -width tenletters
47 Display usage information and exit immediately.
49 Display program version and exit immediately.
55 .Bl -tag -width checkout
56 .It Cm info Oo Fl r Ar repository-path Oc
57 Display information about a repository.
58 This includes some configuration settings from
60 and the number of objects stored in the repository, in packed or
61 loose form, as well as the current on-disk size of these objects.
67 .It Fl r Ar repository-path
68 Use the repository at the specified path.
69 If not specified, assume the repository is located at or above the current
71 If this directory is a
73 work tree, use the repository path associated with this work tree.
75 .It Cm pack Oo Fl a Oc Oo Fl r Ar repository-path Oc Oo Fl x Ar reference Oc Op Ar reference ...
76 Generate a new pack file and a corresponding pack file index.
77 By default, add any loose objects which are reachable via any references
78 to the generated pack file.
82 arguments is specified, only add objects which are reachable via the specified
86 argument may either specify a specific reference or a reference namespace,
87 in which case all references within this namespace will be used.
90 always ignores references in the
92 namespace, effectively treating such references as if they did not refer
100 Add objects to the generated pack file even if they are already packed
101 in a different pack file.
102 Unless this option is specified, only loose objects will be added.
103 .It Fl r Ar repository-path
104 Use the repository at the specified path.
105 If not specified, assume the repository is located at or above the current
107 If this directory is a
109 work tree, use the repository path associated with this work tree.
110 .It Fl x Ar reference
111 Exclude objects reachable via the specified
116 argument may either specify a specific reference or a reference namespace,
117 in which case all references within this namespace will be excluded.
120 option may be specified multiple times to build a list of references to exclude.
122 Exclusion takes precedence over inclusion.
123 If a reference appears in both the included and excluded lists, it will
127 .It Cm indexpack Ar packfile-path
129 Create a pack index for the pack file at
132 A pack index is required for using the corresponding pack file with
134 Usually, a pack index will be created by commands such as
138 as part of regular operation.
140 .Cm gotadmin indexpack
141 command may be used to recover from a corrupt or missing index.
142 A given pack file will always yield the same bit-identical index.
146 must be located within the
148 directory of the repository and should end in
150 The filename of the corresponding pack index is equivalent, except
154 .It Cm listpack Oo Fl h Oc Oo Fl s Oc Ar packfile-path
156 List the contents of the pack file at
159 Each object contained in the pack file will be displayed on a single line.
160 The information shown includes the object ID, object type, object offset,
163 If a packed object is deltified against another object the delta base
164 will be shown as well.
165 For offset deltas, the delta base is identified via an offset into the
167 For reference deltas, the delta base is identified via an object ID.
171 must be located within the
173 directory of the repository and should end in
177 .Cm gotadmin listpack
181 Show object sizes in human-readable form.
183 Display statistics about the pack file after listing objects.
184 This includes the total number of objects stored in the pack file
185 and a break-down of the number of objects per object type.
188 .It Cm cleanup Oo Fl a Oc Oo Fl p Oc Oo Fl n Oc Oo Fl r Ar repository-path Oc Oo Fl q Oc
190 Purge unreferenced loose objects from the repository and display
191 the amount of disk space which has been freed as a result.
193 Unreferenced objects are present in the repository but cannot be
194 reached via any reference in the entire
198 Loose objects are stored as individual files beneath the repository's
201 spread across 256 sub-directories named after the 256 possible
202 hexadecimal values of the first byte of an object identifier.
204 Packed objects stored in pack files under
207 However, if redundant copies of packed objects exist in loose form,
208 such redundant copies will be purged.
210 Objects will usually become unreferenced as a result of deleting
211 branches or tags with
215 Deleting arbitrary references with
217 may also leave unreferenced objects behind.
219 In order to determine the set of objects which are referenced, search
220 all references for commit objects and tag objects, and traverse the
221 corresponding tree object hierarchies.
222 Any loose object IDs not encountered during this search are unreferenced
223 and thus subject to removal.
224 Display the number of commits which have been searched to indicate progress.
228 namespace may prevent objects from being purged.
229 This includes references in the
230 .Pa refs/got/worktree
235 as well as references in the
242 will only purge corresponding objects once such references have been
246 Some Git repositories contain pack index files which lack a corresponding
247 pack file, which is an inconsistent repository state.
249 .Cm gotadmin cleanup -p -n
250 will display a list of affected pack index files.
251 Whenever possible the missing pack files should be restored.
252 If restoring missing pack files is not possible then affected pack index
253 files can be removed with
254 .Cm gotadmin cleanup -p .
258 Git extension is intended to prevent the removal of objects from a repository.
260 will refuse to operate on repositories where this extension is active.
267 Delete all loose objects.
268 By default, objects which are newer than an implementation-defined
269 modification timestamp are kept on disk to prevent race conditions
270 with other commands that add new objects to the repository while
274 Instead of purging unreferenced loose objects, remove any pack index files
275 which do not have a corresponding pack file.
277 Display the usual progress output and summary information but do not actually
278 remove any files from disk.
279 .It Fl r Ar repository-path
280 Use the repository at the specified path.
281 If not specified, assume the repository is located at or above the current
283 If this directory is a
285 work tree, use the repository path associated with this work tree.
287 Suppress progress reporting and disk space summary output.
295 .Xr git-repository 5 ,
298 .An Stefan Sperling Aq Mt stsp@openbsd.org
299 .An Ori Bernstein Aq Mt ori@openbsd.org
302 is a work-in-progress and some features remain to be implemented.
304 At present, the user has to fall back on
306 to perform some tasks.
310 Removing redundant or unreferenced packed objects requires
315 Exporting data from repositories requires
316 .Xr git-fast-export 1 .
318 Importing data into repositories requires
319 .Xr git-fast-import 1 .
322 Disk space savings reported by
324 will be misleading if the repository contains object files that were
325 hard-linked from another repository.
326 Such hard-links will be created by certain
331 will never create hard-linked object files.