gitformat-bundle - The bundle file format
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.
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
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 the shallow clone and a Git bundle¶
Note that the prerequisites does 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.
Because there is no opportunity for negotiation, unknown capabilities cause git bundle to abort.
Part of the git(1) suite