Home Explore Blog CI



git

4th chunk of `Documentation/git-pack-objects.adoc`
82f214976b306a8da55e03252645ab54ef6054aed6a8004a0000000100000fa6
 object data at all,
	including non deltified object, forcing recompression of everything.
	This implies --no-reuse-delta. Useful only in the obscure case where
	wholesale enforcement of a different compression level on the
	packed data is desired.

--compression=<n>::
	Specifies compression level for newly-compressed data in the
	generated pack.  If not specified,  pack compression level is
	determined first by pack.compression,  then by core.compression,
	and defaults to -1,  the zlib default,  if neither is set.
	Add --no-reuse-object if you want to force a uniform compression
	level on all data no matter the source.

--[no-]sparse::
	Toggle the "sparse" algorithm to determine which objects to include in
	the pack, when combined with the "--revs" option. This algorithm
	only walks trees that appear in paths that introduce new objects.
	This can have significant performance benefits when computing
	a pack to send a small change. However, it is possible that extra
	objects are added to the pack-file if the included commits contain
	certain types of direct renames. If this option is not included,
	it defaults to the value of `pack.useSparse`, which is true unless
	otherwise specified.

--thin::
	Create a "thin" pack by omitting the common objects between a
	sender and a receiver in order to reduce network transfer. This
	option only makes sense in conjunction with --stdout.
+
Note: A thin pack violates the packed archive format by omitting
required objects and is thus unusable by Git without making it
self-contained. Use `git index-pack --fix-thin`
(see linkgit:git-index-pack[1]) to restore the self-contained property.

--shallow::
	Optimize a pack that will be provided to a client with a shallow
	repository.  This option, combined with --thin, can result in a
	smaller pack at the cost of speed.

--delta-base-offset::
	A packed archive can express the base object of a delta as
	either a 20-byte object name or as an offset in the
	stream, but ancient versions of Git don't understand the
	latter.  By default, 'git pack-objects' only uses the
	former format for better compatibility.  This option
	allows the command to use the latter format for
	compactness.  Depending on the average delta chain
	length, this option typically shrinks the resulting
	packfile by 3-5 per-cent.
+
Note: Porcelain commands such as `git gc` (see linkgit:git-gc[1]),
`git repack` (see linkgit:git-repack[1]) pass this option by default
in modern Git when they put objects in your repository into pack files.
So does `git bundle` (see linkgit:git-bundle[1]) when it creates a bundle.

--threads=<n>::
	Specifies the number of threads to spawn when searching for best
	delta matches.  This requires that pack-objects be compiled with
	pthreads otherwise this option is ignored with a warning.
	This is meant to reduce packing time on multiprocessor machines.
	The required amount of memory for the delta search window is
	however multiplied by the number of threads.
	Specifying 0 will cause Git to auto-detect the number of CPU's
	and set the number of threads accordingly.

--index-version=<version>[,<offset>]::
	This is intended to be used by the test suite only. It allows
	to force the version for the generated pack index, and to force
	64-bit index entries on objects located above the given offset.

--keep-true-parents::
	With this option, parents that are hidden by grafts are packed
	nevertheless.

--filter=<filter-spec>::
	Omits certain objects (usually blobs) from the resulting
	packfile.  See linkgit:git-rev-list[1] for valid
	`<filter-spec>` forms.

--no-filter::
	Turns off any previous `--filter=` argument.

--missing=<missing-action>::
	A debug option to help with future "partial clone" development.
	This option specifies how missing objects are handled.
+
The form '--missing=error' requests that pack-objects stop with an error if
a missing object is encountered.  If the repository is a partial clone, an
attempt to fetch missing objects will be made before declaring

Title: Advanced Git Pack Objects Options
Summary
The git pack-objects command offers additional advanced options, including flags for controlling compression, delta calculations, thread usage, and object filtering, as well as settings for handling missing objects and creating thin or shallow packs, allowing for fine-tuned optimization and customization of the packing process.