gitformat-bundle - Man Page

The bundle file format

Synopsis

*.bundle
*.bdl

Description

The Git bundle format is a format that represents both refs and Git objects. A bundle is a header in a format similar to git-show-ref(1) followed by a pack in *.pack format.

The format is created and read by the git-bundle(1) command, and supported by e.g. git-fetch(1) and git-clone(1).

Format

We will use ABNF notation to define the Git bundle format. See gitprotocol-common(5) for the details.

A v2 bundle looks like this:

bundle    = signature *prerequisite *reference LF pack
signature = "# v2 git bundle" LF

prerequisite = "-" obj-id SP comment LF
comment      = *CHAR
reference    = obj-id SP refname LF

pack         = ... ; packfile

A v3 bundle looks like this:

bundle    = signature *capability *prerequisite *reference LF pack
signature = "# v3 git bundle" LF

capability   = "@" key ["=" value] LF
prerequisite = "-" obj-id SP comment LF
comment      = *CHAR
reference    = obj-id SP refname LF
key          = 1*(ALPHA / DIGIT / "-")
value        = *(%01-09 / %0b-FF)

pack         = ... ; packfile

Semantics

A Git bundle consists of several parts.

In the bundle format, there can be a comment following a prerequisite obj-id. This is a comment and it has no specific meaning. The writer of the bundle MAY put any string here. The reader of the bundle MUST ignore the comment.

Note on shallow clones and Git bundles

Note that the prerequisites do not represent a shallow-clone boundary. The semantics of the prerequisites and the shallow-clone boundaries are different, and the Git bundle v2 format cannot represent a shallow clone repository.

Capabilities

Because there is no opportunity for negotiation, unknown capabilities cause git bundle to abort.

Git

Part of the git(1) suite

Referenced By

git(1), git-bundle(1), gitformat-pack(5).

10/07/2024 Git 2.47.0 Git Manual