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 A Ar hashing-algorithm Oc 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
89 .It Fl A Ar hashing-algorithm
90 Configure the repository's
92 used for the computation of Git object IDs.
99 Make the repository's HEAD reference point to the specified
101 instead of the default branch
107 command is equivalent to
109 .It Cm info Op Fl r Ar repository-path
110 Display information about a repository.
111 This includes some configuration settings from
113 the object ID hashing algorithm,
114 and the number of objects stored in the repository, in packed or
115 loose form, as well as the current on-disk size of these objects.
121 .It Fl r Ar repository-path
122 Use the repository at the specified path.
123 If not specified, assume the repository is located at or above the current
125 If this directory is a
127 work tree, use the repository path associated with this work tree.
132 .Op Fl r Ar repository-path
133 .Op Fl x Ar reference
136 Generate a new pack file and a corresponding pack file index.
137 By default, add any loose objects which are reachable via any references
138 to the generated pack file.
142 arguments is specified, only add objects which are reachable via the specified
146 argument may either specify a specific reference or a reference namespace,
147 in which case all references within this namespace will be used.
150 always ignores references in the
152 namespace, effectively treating such references as if they did not refer
160 Add objects to the generated pack file even if they are already packed
161 in a different pack file.
162 Unless this option is specified, only loose objects will be added.
164 Force the use of ref-delta representation for deltified objects.
165 If this option is not specified, offset-deltas will be used to represent
168 Suppress progress reporting output.
169 .It Fl r Ar repository-path
170 Use the repository at the specified path.
171 If not specified, assume the repository is located at or above the current
173 If this directory is a
175 work tree, use the repository path associated with this work tree.
176 .It Fl x Ar reference
177 Exclude objects reachable via the specified
182 argument may either specify a specific reference or a reference namespace,
183 in which case all references within this namespace will be excluded.
186 option may be specified multiple times to build a list of references to exclude.
188 Exclusion takes precedence over inclusion.
189 If a reference appears in both the included and excluded lists, it will
193 .It Cm indexpack Ar packfile-path
195 Create a pack index for the pack file at
198 A pack index is required for using the corresponding pack file with
200 Usually, a pack index will be created by commands such as
204 as part of regular operation.
206 .Cm gotadmin indexpack
207 command may be used to recover from a corrupt or missing index.
208 A given pack file will always yield the same bit-identical index.
212 must be located within the
214 directory of the repository and should end in
216 The filename of the corresponding pack index is equivalent, except
226 List the contents of the pack file at
229 Each object contained in the pack file will be displayed on a single line.
230 The information shown includes the object ID, object type, object offset,
233 If a packed object is deltified against another object, the delta base
234 will be shown as well.
235 For offset deltas, the delta base is identified via an offset into the
237 For reference deltas, the delta base is identified via an object ID.
241 must be located within the
243 directory of the repository and should end in
245 The corresponding pack index must exist and can be created with
246 .Cm gotadmin indexpack
250 .Cm gotadmin listpack
254 Show object sizes in human-readable form.
256 Display statistics about the pack file after listing objects.
257 This includes the total number of objects stored in the pack file
258 and a break-down of the number of objects per object type.
264 .Op Fl r Ar repository-path
267 Purge unreferenced loose objects and redundant pack files from the
268 repository and display the amount of disk space which has been freed
271 Unreferenced objects are present in the repository but cannot be
272 reached via any reference in the entire
275 Objects will usually become unreferenced as a result of deleting
276 branches, tags, or other references with
282 Loose objects are stored as individual files beneath the repository's
285 spread across 256 sub-directories named after the 256 possible
286 hexadecimal values of the first byte of an object identifier.
288 Packed objects are stored in pack files under
291 If redundant copies of packed objects exist in loose form, such
292 redundant copies will be purged.
293 If all the objects of a pack file are present in other pack files,
294 the redundant pack file will be purged.
295 Pack files will usually become redundant as a result of repacking the
302 namespace may prevent objects from being purged.
303 This includes references in the
304 .Pa refs/got/worktree
309 as well as references in the
316 will only purge corresponding objects once such references have been
319 .Cm got histedit -X ,
325 Git extension is intended to prevent the removal of objects from a repository.
327 will refuse to operate on repositories where this extension is active.
329 For compatibility with Git, if a file with the extension
331 exists and corresponds to a pack file with the extension
333 then this pack file will not be removed.
335 Some Git repositories contain pack index files which lack a corresponding
336 pack file, which is an inconsistent repository state.
338 .Cm gotadmin cleanup -p -n
339 will display a list of affected pack index files.
340 Whenever possible, the missing pack files should be restored.
341 If restoring missing pack files is not possible, then affected pack index
342 files can be removed with
343 .Cm gotadmin cleanup -p .
350 Delete all redundant loose and packed objects.
351 By default, objects which are newer than an implementation-defined
352 modification timestamp are kept on disk to prevent race conditions
353 with other commands that add new objects to the repository while
357 Display the usual progress output and summary information but do not actually
358 remove any files from disk.
360 Instead of purging unreferenced loose objects and redundant pack files,
361 remove any pack index files which do not have a corresponding pack file.
363 Suppress progress reporting and disk space summary output.
364 .It Fl r Ar repository-path
365 Use the repository at the specified path.
366 If not specified, assume the repository is located at or above the current
368 If this directory is a
370 work tree, use the repository path associated with this work tree.
375 .Op Fl r Ar repository-path
376 .Op Fl x Ar reference
379 Dump the contents of the repository to standard output in Git bundle format.
383 arguments is specified, only add objects which are reachable via the specified
387 argument may either specify a specific reference or a reference namespace,
388 in which case all references within this namespace will be used.
396 Suppress progress reporting output.
397 .It Fl r Ar repository-path
398 Use the repository at the specified path.
399 If not specified, assume the repository is located at or above the current
401 If this directory is a
403 work tree, use the repository path associated with this work tree.
404 .It Fl x Ar reference
405 Exclude objects reachable via the specified
410 argument may either specify a specific reference or a reference namespace,
411 in which case all references within this namespace will be excluded.
414 option may be specified multiple times to build a list of references to exclude.
416 Exclusion takes precedence over inclusion.
417 If a reference appears in both the included and excluded lists, it will
423 .Op Fl l Ar bundle-path
424 .Op Fl r Ar repository-path
427 Read a Git bundle stream from standard input and load its data into
432 arguments are provided then only load the specified references
434 Otherwise, all references will be loaded.
440 .It Fl l Ar bundle-path
441 List references available for loading from the bundle at the specified
443 and exit immediately.
446 option is specified then no
448 arguments are allowed.
451 option is incompatible with the
455 Attempt to load the bundle but don't install new packfile or update any
457 Can be used to verify the integrity of the bundle.
459 Suppress progress reporting output.
460 .It Fl r Ar repository-path
461 Use the repository at the specified path.
462 If not specified, assume the repository is located at or above the
463 current working directory.
464 If this directory is a
466 work tree, use the repository path associated with this work tree.
474 .Xr git-repository 5 ,
477 .An Christian Weisgerber Aq Mt naddy@openbsd.org
478 .An Josh Rickmar Aq Mt jrick@zettaport.com
479 .An Klemens Nanni Aq Mt kn@openbsd.org
480 .An Omar Polo Aq Mt op@openbsd.org
481 .An Ori Bernstein Aq Mt ori@openbsd.org
482 .An Stefan Sperling Aq Mt stsp@openbsd.org
483 .An Tracey Emery Aq Mt tracey@traceyemery.net
486 is a work-in-progress and some features remain to be implemented.
488 At present, the user has to fall back on
490 to perform some tasks.
494 Exporting data from repositories requires
495 .Xr git-fast-export 1 .
497 Importing data into repositories requires
498 .Xr git-fast-import 1 .
501 Disk space savings reported by
503 will be misleading if the repository contains object files that were
504 hard-linked from another repository.
505 Such hard-links will be created by certain
510 will never create hard-linked object files.