Home Explore Blog CI



git

2nd chunk of `Documentation/git-bundle.adoc`
e46b3ee991e86f838fc37121bd42ecdb4b73e811ce2d115e0000000100000fa3
 is zero for success, but will
	be nonzero if the bundle file is invalid. If 'file' is `-`, the
	bundle is read from stdin.

list-heads <file>::
	Lists the references defined in the bundle.  If followed by a
	list of references, only references matching those given are
	printed out. If 'file' is `-`, the bundle is read from stdin.

unbundle <file>::
	Passes the objects in the bundle to 'git index-pack'
	for storage in the repository, then prints the names of all
	defined references. If a list of references is given, only
	references matching those in the list are printed. This command is
	really plumbing, intended to be called only by 'git fetch'.
	If 'file' is `-`, the bundle is read from stdin.

<git-rev-list-args>::
	A list of arguments, acceptable to 'git rev-parse' and
	'git rev-list' (and containing a named ref, see SPECIFYING REFERENCES
	below), that specifies the specific objects and references
	to transport.  For example, `master~10..master` causes the
	current master reference to be packaged along with all objects
	added since its 10th ancestor commit.  There is no explicit
	limit to the number of references and objects that may be
	packaged.


[<refname>...]::
	A list of references used to limit the references reported as
	available. This is principally of use to 'git fetch', which
	expects to receive only those references asked for and not
	necessarily everything in the pack (in this case, 'git bundle' acts
	like 'git fetch-pack').

--progress::
	Progress status is reported on the standard error stream
	by default when it is attached to a terminal, unless -q
	is specified. This flag forces progress status even if
	the standard error stream is not directed to a terminal.

--version=<version>::
	Specify the bundle version.  Version 2 is the older format and can only be
	used with SHA-1 repositories; the newer version 3 contains capabilities that
	permit extensions. The default is the oldest supported format, based on the
	hash algorithm in use.

-q::
--quiet::
	This flag makes the command not to report its progress
	on the standard error stream.

SPECIFYING REFERENCES
---------------------

Revisions must be accompanied by reference names to be packaged in a
bundle.  Alternatively `--all` can be used to package all refs.

More than one reference may be packaged, and more than one set of prerequisite objects can
be specified.  The objects packaged are those not contained in the
union of the prerequisites.

The 'git bundle create' command resolves the reference names for you
using the same rules as `git rev-parse --abbrev-ref=loose`. Each
prerequisite can be specified explicitly (e.g. `^master~10`), or implicitly
(e.g. `master~10..master`, `--since=10.days.ago master`).

All of these simple cases are OK (assuming we have a "master" and
"next" branch):

----------------
$ git bundle create master.bundle master
$ echo master | git bundle create master.bundle --stdin
$ git bundle create master-and-next.bundle master next
$ (echo master; echo next) | git bundle create master-and-next.bundle --stdin
----------------

And so are these (and the same but omitted `--stdin` examples):

----------------
$ git bundle create recent-master.bundle master~10..master
$ git bundle create recent-updates.bundle master~10..master next~5..next
----------------

A revision name or a range whose right-hand-side cannot be resolved to
a reference is not accepted:

----------------
$ git bundle create HEAD.bundle $(git rev-parse HEAD)
fatal: Refusing to create empty bundle.
$ git bundle create master-yesterday.bundle master~10..master~5
fatal: Refusing to create empty bundle.
----------------

OBJECT PREREQUISITES
--------------------

When creating bundles it is possible to create a self-contained bundle
that can be unbundled in a repository with no common history, as well
as providing negative revisions to exclude objects needed in the
earlier parts of the history.

Feeding a revision such as `new` to `git bundle create` will create a
bundle file

Title: Git Bundle Command
Summary
The git-bundle command is used to create, verify, and manipulate bundle files in Git, allowing for the transfer of objects and refs between repositories without a network connection. The command supports various options, including creating bundles with specific references, verifying bundle integrity, listing references, and unbundling objects into a repository. It also provides features such as progress reporting, version specification, and reference naming, making it a versatile tool for managing and transferring Git data.