git-pack-objects
Create a packed archive of Git objects
SYNOPSIS
git pack-objects [--all-progress] [--no-progress] [--stdout] [--thin] [--delta-base-offset] [--non-empty] [--shallow] < prefix
PARAMETERS
--all-progress
Report progress to stderr even if stderr is not a TTY.
--no-progress
Do not report any progress to stderr.
--stdout
Write the pack to standard output instead of a file.
--thin
Create a 'thin' pack. This creates deltas against objects not included in the pack, assuming the recipient has those objects. Useful for sending incremental updates.
--delta-base-offset
Use offset deltas instead of ref deltas. This is faster and more efficient, especially for large repositories.
--non-empty
Do not create an empty pack even if no objects are specified as input. Useful when expecting objects from another command.
--shallow
Assume the objects that git upload-pack and git fetch-pack will have on the other side are specified in .git/shallow
prefix
Input stream of object names. Each name should be a valid git object id (SHA-1 hash) separated by a newline character.
DESCRIPTION
The git-pack-objects command is a plumbing command (designed for scripts and backends) that takes a list of objects (usually commits, trees, and blobs) and creates a packed archive (a 'packfile') containing those objects. This command efficiently stores and compresses Git objects, reducing storage space and improving network transfer speeds. It determines the optimal way to represent objects based on delta compression and object relationships.
The input is a list of object names (or references) to be included in the packfile. Git determines the object types and dependencies required for a complete, self-contained archive. The resulting packfile and its associated index are written to disk, ready for use by other Git commands such as git-fetch, git-push, and git-gc.
CAVEATS
This is a plumbing command; end users are rarely expected to call it directly. It's typically used by other Git commands to manage packfiles internally.
PERFORMANCE CONSIDERATIONS
Using --delta-base-offset can significantly improve performance during packfile creation, especially with large repositories. Thin packs (--thin) can be smaller, but require the receiving end to have the base objects for the deltas.
INPUT FORMAT
The input to git-pack-objects is a simple list of object names, one per line, read from standard input. These object names are typically generated by other Git commands, such as git-rev-list or git-for-each-ref.
SEE ALSO
git-repack(1), git-index-pack(1), git-prune(1)