Home Explore Blog CI



git

3rd chunk of `Documentation/git-repack.adoc`
c1281e2f47ac55c604634d6fce217dfcb076fbf5c3a5e3830000000100000a69
 option may result in
	a larger and slower repository; see the discussion in
	`pack.packSizeLimit`.

--filter=<filter-spec>::
	Remove objects matching the filter specification from the
	resulting packfile and put them into a separate packfile. Note
	that objects used in the working directory are not filtered
	out. So for the split to fully work, it's best to perform it
	in a bare repo and to use the `-a` and `-d` options along with
	this option.  Also `--no-write-bitmap-index` (or the
	`repack.writebitmaps` config option set to `false`) should be
	used otherwise writing bitmap index will fail, as it supposes
	a single packfile containing all the objects. See
	linkgit:git-rev-list[1] for valid `<filter-spec>` forms.

--filter-to=<dir>::
	Write the pack containing filtered out objects to the
	directory `<dir>`. Only useful with `--filter`. This can be
	used for putting the pack on a separate object directory that
	is accessed through the Git alternates mechanism. **WARNING:**
	If the packfile containing the filtered out objects is not
	accessible, the repo can become corrupt as it might not be
	possible to access the objects in that packfile. See the
	`objects` and `objects/info/alternates` sections of
	linkgit:gitrepository-layout[5].

-b::
--write-bitmap-index::
	Write a reachability bitmap index as part of the repack. This
	only makes sense when used with `-a`, `-A` or `-m`, as the bitmaps
	must be able to refer to all reachable objects. This option
	overrides the setting of `repack.writeBitmaps`. This option
	has no effect if multiple packfiles are created, unless writing a
	MIDX (in which case a multi-pack bitmap is created).

--pack-kept-objects::
	Include objects in `.keep` files when repacking.  Note that we
	still do not delete `.keep` packs after `pack-objects` finishes.
	This means that we may duplicate objects, but this makes the
	option safe to use when there are concurrent pushes or fetches.
	This option is generally only useful if you are writing bitmaps
	with `-b` or `repack.writeBitmaps`, as it ensures that the
	bitmapped packfile has the necessary objects.

--keep-pack=<pack-name>::
	Exclude the given pack from repacking. This is the equivalent
	of having `.keep` file on the pack. `<pack-name>` is the
	pack file name without leading directory (e.g. `pack-123.pack`).
	The option can be specified multiple times to keep multiple
	packs.

--unpack-unreachable=<when>::
	When loosening unreachable objects, do not bother loosening any
	objects older than `<when>`. This can be used to optimize out
	the write of any objects that would be immediately pruned by
	a follow-up `git prune`.

-k::
--keep-unreachable::

Title: Git Repack Filtering and Indexing Options
Summary
The git-repack command offers various options for filtering objects, writing bitmap indexes, and keeping specific packs or objects, allowing for customized repository management and optimization, including the ability to exclude certain packs, keep unreachable objects, and loosen objects older than a specified time, which can help improve repository performance and reduce storage space.