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 init Oo Fl b Ar branch Oc Ar repository-path
57 Create a new empty repository at the specified
64 command must be used to populate the empty repository before
73 Make the repository's HEAD reference point to the specified
75 instead of the default branch
78 .It Cm info Op Fl r Ar repository-path
79 Display information about a repository.
80 This includes some configuration settings from
82 and the number of objects stored in the repository, in packed or
83 loose form, as well as the current on-disk size of these objects.
89 .It Fl r Ar repository-path
90 Use the repository at the specified path.
91 If not specified, assume the repository is located at or above the current
93 If this directory is a
95 work tree, use the repository path associated with this work tree.
100 .Op Fl r Ar repository-path
101 .Op Fl x Ar reference
104 Generate a new pack file and a corresponding pack file index.
105 By default, add any loose objects which are reachable via any references
106 to the generated pack file.
110 arguments is specified, only add objects which are reachable via the specified
114 argument may either specify a specific reference or a reference namespace,
115 in which case all references within this namespace will be used.
118 always ignores references in the
120 namespace, effectively treating such references as if they did not refer
128 Add objects to the generated pack file even if they are already packed
129 in a different pack file.
130 Unless this option is specified, only loose objects will be added.
132 Force the use of ref-delta representation for deltified objects.
133 If this option is not specified, offset-deltas will be used to represent
136 Suppress progress reporting output.
137 .It Fl r Ar repository-path
138 Use the repository at the specified path.
139 If not specified, assume the repository is located at or above the current
141 If this directory is a
143 work tree, use the repository path associated with this work tree.
144 .It Fl x Ar reference
145 Exclude objects reachable via the specified
150 argument may either specify a specific reference or a reference namespace,
151 in which case all references within this namespace will be excluded.
154 option may be specified multiple times to build a list of references to exclude.
156 Exclusion takes precedence over inclusion.
157 If a reference appears in both the included and excluded lists, it will
161 .It Cm indexpack Ar packfile-path
163 Create a pack index for the pack file at
166 A pack index is required for using the corresponding pack file with
168 Usually, a pack index will be created by commands such as
172 as part of regular operation.
174 .Cm gotadmin indexpack
175 command may be used to recover from a corrupt or missing index.
176 A given pack file will always yield the same bit-identical index.
180 must be located within the
182 directory of the repository and should end in
184 The filename of the corresponding pack index is equivalent, except
194 List the contents of the pack file at
197 Each object contained in the pack file will be displayed on a single line.
198 The information shown includes the object ID, object type, object offset,
201 If a packed object is deltified against another object, the delta base
202 will be shown as well.
203 For offset deltas, the delta base is identified via an offset into the
205 For reference deltas, the delta base is identified via an object ID.
209 must be located within the
211 directory of the repository and should end in
213 The corresponding pack index must exist and can be created with
214 .Cm gotadmin indexpack
218 .Cm gotadmin listpack
222 Show object sizes in human-readable form.
224 Display statistics about the pack file after listing objects.
225 This includes the total number of objects stored in the pack file
226 and a break-down of the number of objects per object type.
232 .Op Fl r Ar repository-path
235 Purge unreferenced loose objects and redundant pack files from the
236 repository and display the amount of disk space which has been freed
239 Unreferenced objects are present in the repository but cannot be
240 reached via any reference in the entire
244 Loose objects are stored as individual files beneath the repository's
247 spread across 256 sub-directories named after the 256 possible
248 hexadecimal values of the first byte of an object identifier.
250 Packed objects are stored in pack files under
253 If redundant copies of packed objects exist in loose form, such
254 redundant copies will be purged.
255 If all the objects of a pack file are present in other pack files,
256 the redundant pack file will be purged.
258 For compatibility with Git, if a matching file
260 exists for a given pack file, this pack file won't be removed.
262 Objects will usually become unreferenced as a result of deleting
263 branches or tags with
267 Deleting arbitrary references with
269 may also leave unreferenced objects behind.
271 Pack files will usually become redundant as a result of repacking the
276 In order to determine the set of objects which are referenced, search
277 all references for commit objects and tag objects, and traverse the
278 corresponding tree object hierarchies.
279 Any loose object IDs not encountered during this search are unreferenced
280 and thus subject to removal.
281 Display the number of commits which have been searched to indicate progress.
285 namespace may prevent objects from being purged.
286 This includes references in the
287 .Pa refs/got/worktree
292 as well as references in the
299 will only purge corresponding objects once such references have been
302 .Cm got histedit -X ,
306 Some Git repositories contain pack index files which lack a corresponding
307 pack file, which is an inconsistent repository state.
309 .Cm gotadmin cleanup -p -n
310 will display a list of affected pack index files.
311 Whenever possible, the missing pack files should be restored.
312 If restoring missing pack files is not possible, then affected pack index
313 files can be removed with
314 .Cm gotadmin cleanup -p .
318 Git extension is intended to prevent the removal of objects from a repository.
320 will refuse to operate on repositories where this extension is active.
327 Delete all loose objects.
328 By default, objects which are newer than an implementation-defined
329 modification timestamp are kept on disk to prevent race conditions
330 with other commands that add new objects to the repository while
334 Display the usual progress output and summary information but do not actually
335 remove any files from disk.
337 Instead of purging unreferenced loose objects, remove any pack index files
338 which do not have a corresponding pack file.
340 Suppress progress reporting and disk space summary output.
341 .It Fl r Ar repository-path
342 Use the repository at the specified path.
343 If not specified, assume the repository is located at or above the current
345 If this directory is a
347 work tree, use the repository path associated with this work tree.
355 .Xr git-repository 5 ,
358 .An Christian Weisgerber Aq Mt naddy@openbsd.org
359 .An Josh Rickmar Aq Mt jrick@zettaport.com
360 .An Klemens Nanni Aq Mt kn@openbsd.org
361 .An Ori Bernstein Aq Mt ori@openbsd.org
362 .An Stefan Sperling Aq Mt stsp@openbsd.org
363 .An Tracey Emery Aq Mt tracey@traceyemery.net
366 is a work-in-progress and some features remain to be implemented.
368 At present, the user has to fall back on
370 to perform some tasks.
374 Removing redundant or unreferenced packed objects requires
379 Exporting data from repositories requires
380 .Xr git-fast-export 1 .
382 Importing data into repositories requires
383 .Xr git-fast-import 1 .
386 Disk space savings reported by
388 will be misleading if the repository contains object files that were
389 hard-linked from another repository.
390 Such hard-links will be created by certain
395 will never create hard-linked object files.