commit 16cd1323a1652e0fb130bfd965e6f930907bd96e
from: Stefan Sperling
Any object which is not directly or indirectly reachable via a - reference is subject to deletion by Git's garbage collector.
+ reference is subject to deletion by Git's garbage collector or +gotadmin cleanup
.
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |
Each work tree has a universal unique identifier. When a work tree
is checked out or updated, this identifier is used to create a reference to
the current base commit in the Git repository. The presence of this
- reference prevents Git garbage collectors from discarding the base commit
- and any objects it refers to. When a work tree is no longer needed its
- reference can be deleted from the Git repository with got
- ref -d
.
gotadmin
+ cleanup
from discarding the base commit and any objects it refers to.
+ When a work tree is no longer needed its reference can be deleted from the
+ Git repository with got ref -d
.
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |
-t
]
[-q
] [-v
]
[-R
reference]
- [remote-repository]
+ [-X
] [remote-repository]
gotadmin cleanup
.
+ Maintaining custom changes in a mirror repository is therefore
+ discouraged.
In any case, references in the “refs/tags/” namespace will always be fetched and mapped directly to local references in the same namespace.
@@ -322,7 +323,7 @@ present in the remote repository. Only references are deleted. Any commit, tree, tag, and blob objects belonging to deleted branches or tags remain in the repository and may be removed separately with Git's - garbage collector.gotadmin cleanup
.
-l
-X
With -X
, the
+ remote-repository argument is mandatory and no
+ other options except -r
,
+ -v
, and -q
are
+ allowed.
Only references are deleted. Any commit, tree, tag, and + blob objects fetched from a remote repository will generally be + stored in pack files and may be removed separately with + git-repack(1) and Git's garbage collector.
-r
.gotadmin
+ cleanup
. Cannot be used together with any other options except
+ -r
.
branch
@@ -1006,7 +1023,8 @@
gotadmin
+ cleanup
.
-n
-R
] [-I
]
path ...
got
+ status
ignore pattern will not be added.
The options for got add
are as
follows:
got add
will refuse to run if a specified
path is a directory.-I
got
- status
ignore pattern.got status
+ ignore pattern.remove
@@ -1368,7 +1387,8 @@
backout
.rebase
[-a
] [-c
]
- [-l
] [branch]-l
] [-X
]
+ [branch]
got rebase -l
command. Removal of these
references makes objects which become unreachable via any reference
- subject to removal by Git's garbage collector.
+ subject to removal by Git's garbage collector or
+ gotadmin cleanup
.
While rebasing commits, show the status of each affected file, using the following status codes:
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |
ls
listpack
.cleanup
+ [-p
] [-n
]
+ [-r
repository-path]
+ [-q
]Unreferenced objects are present in the repository but cannot + be reached via any reference in the entire refs/ + namespace.
+Loose objects are stored as individual files beneath the + repository's objects/ directory, spread across + 256 sub-directories named after the 256 possible hexadecimal values of + the first byte of an object identifier.
+Packed objects stored in pack files under + objects/pack/ will not be purged. However, if + redundant copies of packed objects exist in loose form, such redundant + copies will be purged.
+Objects will usually become unreferenced as a result of
+ deleting branches or tags with got branch -d
or
+ got tag -d
. Deleting arbitrary references with
+ got ref -d
may also leave unreferenced objects
+ behind.
In order to determine the set of objects which are referenced, + search all references for commit objects and tag objects, and traverse + the corresponding tree object hierarchies. Any loose object IDs not + encountered during this search are unreferenced and thus subject to + removal. Display the number of commits which have been searched to + indicate progress.
+References in the refs/got namespace
+ may prevent objects from being purged. This includes references in the
+ refs/got/worktree namespace created by
+ got checkout
and got
+ update
, as well as references in the
+ refs/got/backup namespace created by
+ got rebase
and got
+ histedit
. gotadmin cleanup
will only
+ purge corresponding objects once such references have been deleted with
+ got ref -d
.
Some Git repositories contain pack index files which lack a
+ corresponding pack file, which is an inconsistent repository state. In
+ such cases, gotadmin cleanup -p -n
will display
+ a list of affected pack index files. Whenever possible the missing pack
+ files should be restored. If restoring missing pack files is not
+ possible then affected pack index files can be removed with
+ gotadmin cleanup -p
.
The “preciousObjects” Git extension is intended
+ to prevent the removal of objects from a repository.
+ gotadmin cleanup
will refuse to operate on
+ repositories where this extension is active.
The options for gotadmin cleanup
are
+ as follows:
-p
-n
-r
+ repository-path-q
cl
cleanup
.gotadmin
is a work-in-progress and some
+ features remain to be implemented.
At present, the user has to fall back on git(1) + to perform some tasks. In particular:
+Disk space savings reported by gotadmin
+ cleanup
will be misleading if the repository contains object files
+ that were hard-linked from another repository. Such hard-links will be
+ created by certain git(1) commands. By itself,
+ got(1) will never create hard-linked object files.
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |
June 22, 2021 | +July 26, 2021 | OpenBSD 6.9 |