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
62 the new repository must be populated before
67 command can be used to populate the new repository with data from
69 Alternatively, on a server running
71 the new repository can be made available to
75 clients by adding the repository to
79 Clients may then clone the new repository from the server, populate the cloned
80 repository, and then populate the new repository on the server via
90 Make the repository's HEAD reference point to the specified
92 instead of the default branch
98 command is equivalent to
100 .It Cm info Op Fl r Ar repository-path
101 Display information about a repository.
102 This includes some configuration settings from
104 and the number of objects stored in the repository, in packed or
105 loose form, as well as the current on-disk size of these objects.
111 .It Fl r Ar repository-path
112 Use the repository at the specified path.
113 If not specified, assume the repository is located at or above the current
115 If this directory is a
117 work tree, use the repository path associated with this work tree.
122 .Op Fl r Ar repository-path
123 .Op Fl x Ar reference
126 Generate a new pack file and a corresponding pack file index.
127 By default, add any loose objects which are reachable via any references
128 to the generated pack file.
132 arguments is specified, only add objects which are reachable via the specified
136 argument may either specify a specific reference or a reference namespace,
137 in which case all references within this namespace will be used.
140 always ignores references in the
142 namespace, effectively treating such references as if they did not refer
150 Add objects to the generated pack file even if they are already packed
151 in a different pack file.
152 Unless this option is specified, only loose objects will be added.
154 Force the use of ref-delta representation for deltified objects.
155 If this option is not specified, offset-deltas will be used to represent
158 Suppress progress reporting output.
159 .It Fl r Ar repository-path
160 Use the repository at the specified path.
161 If not specified, assume the repository is located at or above the current
163 If this directory is a
165 work tree, use the repository path associated with this work tree.
166 .It Fl x Ar reference
167 Exclude objects reachable via the specified
172 argument may either specify a specific reference or a reference namespace,
173 in which case all references within this namespace will be excluded.
176 option may be specified multiple times to build a list of references to exclude.
178 Exclusion takes precedence over inclusion.
179 If a reference appears in both the included and excluded lists, it will
183 .It Cm indexpack Ar packfile-path
185 Create a pack index for the pack file at
188 A pack index is required for using the corresponding pack file with
190 Usually, a pack index will be created by commands such as
194 as part of regular operation.
196 .Cm gotadmin indexpack
197 command may be used to recover from a corrupt or missing index.
198 A given pack file will always yield the same bit-identical index.
202 must be located within the
204 directory of the repository and should end in
206 The filename of the corresponding pack index is equivalent, except
216 List the contents of the pack file at
219 Each object contained in the pack file will be displayed on a single line.
220 The information shown includes the object ID, object type, object offset,
223 If a packed object is deltified against another object, the delta base
224 will be shown as well.
225 For offset deltas, the delta base is identified via an offset into the
227 For reference deltas, the delta base is identified via an object ID.
231 must be located within the
233 directory of the repository and should end in
235 The corresponding pack index must exist and can be created with
236 .Cm gotadmin indexpack
240 .Cm gotadmin listpack
244 Show object sizes in human-readable form.
246 Display statistics about the pack file after listing objects.
247 This includes the total number of objects stored in the pack file
248 and a break-down of the number of objects per object type.
254 .Op Fl r Ar repository-path
257 Purge unreferenced loose objects and redundant pack files from the
258 repository and display the amount of disk space which has been freed
261 Unreferenced objects are present in the repository but cannot be
262 reached via any reference in the entire
265 Objects will usually become unreferenced as a result of deleting
266 branches, tags, or other references with
272 Loose objects are stored as individual files beneath the repository's
275 spread across 256 sub-directories named after the 256 possible
276 hexadecimal values of the first byte of an object identifier.
278 Packed objects are stored in pack files under
281 If redundant copies of packed objects exist in loose form, such
282 redundant copies will be purged.
283 If all the objects of a pack file are present in other pack files,
284 the redundant pack file will be purged.
285 Pack files will usually become redundant as a result of repacking the
292 namespace may prevent objects from being purged.
293 This includes references in the
294 .Pa refs/got/worktree
299 as well as references in the
306 will only purge corresponding objects once such references have been
309 .Cm got histedit -X ,
315 Git extension is intended to prevent the removal of objects from a repository.
317 will refuse to operate on repositories where this extension is active.
319 For compatibility with Git, if a file with the extension
321 exists and corresponds to a pack file with the extension
323 then this pack file will not be removed.
325 Some Git repositories contain pack index files which lack a corresponding
326 pack file, which is an inconsistent repository state.
328 .Cm gotadmin cleanup -p -n
329 will display a list of affected pack index files.
330 Whenever possible, the missing pack files should be restored.
331 If restoring missing pack files is not possible, then affected pack index
332 files can be removed with
333 .Cm gotadmin cleanup -p .
340 Delete all redundant loose and packed objects.
341 By default, objects which are newer than an implementation-defined
342 modification timestamp are kept on disk to prevent race conditions
343 with other commands that add new objects to the repository while
347 Display the usual progress output and summary information but do not actually
348 remove any files from disk.
350 Instead of purging unreferenced loose objects and redundant pack files,
351 remove any pack index files which do not have a corresponding pack file.
353 Suppress progress reporting and disk space summary output.
354 .It Fl r Ar repository-path
355 Use the repository at the specified path.
356 If not specified, assume the repository is located at or above the current
358 If this directory is a
360 work tree, use the repository path associated with this work tree.
365 .Op Fl r Ar repository-path
366 .Op Fl x Ar reference
369 Dump the contents of the repository to standard output in Git bundle format.
373 arguments is specified, only add objects which are reachable via the specified
377 argument may either specify a specific reference or a reference namespace,
378 in which case all references within this namespace will be used.
386 Suppress progress reporting output.
387 .It Fl r Ar repository-path
388 Use the repository at the specified path.
389 If not specified, assume the repository is located at or above the current
391 If this directory is a
393 work tree, use the repository path associated with this work tree.
394 .It Fl x Ar reference
395 Exclude objects reachable via the specified
400 argument may either specify a specific reference or a reference namespace,
401 in which case all references within this namespace will be excluded.
404 option may be specified multiple times to build a list of references to exclude.
406 Exclusion takes precedence over inclusion.
407 If a reference appears in both the included and excluded lists, it will
413 .Op Fl l Ar bundle-path
414 .Op Fl r Ar repository-path
417 Read a Git bundle stream from standard input and load its data into
422 arguments are provided then only load the specified references
424 Otherwise, all references will be loaded.
430 .It Fl l Ar bundle-path
431 List references available for loading from the bundle at the specified
433 and exit immediately.
436 option is specified then no
438 arguments are allowed.
441 option is incompatible with the
445 Attempt to load the bundle but don't install new packfile or update any
447 Can be used to verify the integrity of the bundle.
449 Suppress progress reporting output.
450 .It Fl r Ar repository-path
451 Use the repository at the specified path.
452 If not specified, assume the repository is located at or above the
453 current working directory.
454 If this directory is a
456 work tree, use the repository path associated with this work tree.
464 .Xr git-repository 5 ,
467 .An Christian Weisgerber Aq Mt naddy@openbsd.org
468 .An Josh Rickmar Aq Mt jrick@zettaport.com
469 .An Klemens Nanni Aq Mt kn@openbsd.org
470 .An Omar Polo Aq Mt op@openbsd.org
471 .An Ori Bernstein Aq Mt ori@openbsd.org
472 .An Stefan Sperling Aq Mt stsp@openbsd.org
473 .An Tracey Emery Aq Mt tracey@traceyemery.net
476 is a work-in-progress and some features remain to be implemented.
478 At present, the user has to fall back on
480 to perform some tasks.
484 Exporting data from repositories requires
485 .Xr git-fast-export 1 .
487 Importing data into repositories requires
488 .Xr git-fast-import 1 .
491 Disk space savings reported by
493 will be misleading if the repository contains object files that were
494 hard-linked from another repository.
495 Such hard-links will be created by certain
500 will never create hard-linked object files.