Home Explore Blog CI



git

1st chunk of `Documentation/git-pack-objects.adoc`
46fe32e9150d3aa76452d0e69651620eaa8806731af931d80000000100000fa2
git-pack-objects(1)
===================

NAME
----
git-pack-objects - Create a packed archive of objects


SYNOPSIS
--------
[verse]
'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied]
	[--no-reuse-delta] [--delta-base-offset] [--non-empty]
	[--local] [--incremental] [--window=<n>] [--depth=<n>]
	[--revs [--unpacked | --all]] [--keep-pack=<pack-name>]
	[--cruft] [--cruft-expiration=<time>]
	[--stdout [--filter=<filter-spec>] | <base-name>]
	[--shallow] [--keep-true-parents] [--[no-]sparse]
	[--name-hash-version=<n>] < <object-list>


DESCRIPTION
-----------
Reads list of objects from the standard input, and writes either one or
more packed archives with the specified base-name to disk, or a packed
archive to the standard output.

A packed archive is an efficient way to transfer a set of objects
between two repositories as well as an access efficient archival
format.  In a packed archive, an object is either stored as a
compressed whole or as a difference from some other object.
The latter is often called a delta.

The packed archive format (.pack) is designed to be self-contained
so that it can be unpacked without any further information. Therefore,
each object that a delta depends upon must be present within the pack.

A pack index file (.idx) is generated for fast, random access to the
objects in the pack. Placing both the index file (.idx) and the packed
archive (.pack) in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
enables Git to read from the pack archive.

The 'git unpack-objects' command can read the packed archive and
expand the objects contained in the pack into "one-file
one-object" format; this is typically done by the smart-pull
commands when a pack is created on-the-fly for efficient network
transport by their peers.


OPTIONS
-------
base-name::
	Write into pairs of files (.pack and .idx), using
	<base-name> to determine the name of the created file.
	When this option is used, the two files in a pair are written in
	<base-name>-<SHA-1>.{pack,idx} files.  <SHA-1> is a hash
	based on the pack content and is written to the standard
	output of the command.

--stdout::
	Write the pack contents (what would have been written to
	.pack file) out to the standard output.

--revs::
	Read the revision arguments from the standard input, instead of
	individual object names.  The revision arguments are processed
	the same way as 'git rev-list' with the `--objects` flag
	uses its `commit` arguments to build the list of objects it
	outputs.  The objects on the resulting list are packed.
	Besides revisions, `--not` or `--shallow <SHA-1>` lines are
	also accepted.

--unpacked::
	This implies `--revs`.  When processing the list of
	revision arguments read from the standard input, limit
	the objects packed to those that are not already packed.

--all::
	This implies `--revs`.  In addition to the list of
	revision arguments read from the standard input, pretend
	as if all refs under `refs/` are specified to be
	included.

--include-tag::
	Include unasked-for annotated tags if the object they
	reference was included in the resulting packfile.  This
	can be useful to send new tags to native Git clients.

--stdin-packs::
	Read the basenames of packfiles (e.g., `pack-1234abcd.pack`)
	from the standard input, instead of object names or revision
	arguments. The resulting pack contains all objects listed in the
	included packs (those not beginning with `^`), excluding any
	objects listed in the excluded packs (beginning with `^`).
+
Incompatible with `--revs`, or options that imply `--revs` (such as
`--all`), with the exception of `--unpacked`, which is compatible.

--cruft::
	Packs unreachable objects into a separate "cruft" pack, denoted
	by the existence of a `.mtimes` file. Typically used by `git
	repack --cruft`. Callers provide a list of pack names and
	indicate which packs will remain in the repository, along with
	which packs will be deleted

Title: Git Pack Objects Documentation
Summary
The git-pack-objects command creates a packed archive of Git objects, providing an efficient way to transfer and store objects between repositories, with various options for customization and compatibility.