2 .\" Title: gitformat-bundle
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.42.0.rc1
10 .TH "GITFORMAT\-BUNDLE" "5" "2023\-08\-09" "Git 2\&.42\&.0\&.rc1" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 gitformat-bundle \- The bundle file format
41 The Git bundle format is a format that represents both refs and Git objects\&. A bundle is a header in a format similar to \fBgit-show-ref\fR(1) followed by a pack in *\&.pack format\&.
43 The format is created and read by the \fBgit-bundle\fR(1) command, and supported by e\&.g\&. \fBgit-fetch\fR(1) and \fBgit-clone\fR(1)\&.
46 We will use ABNF notation to define the Git bundle format\&. See \fBgitprotocol-common\fR(5) for the details\&.
48 A v2 bundle looks like this:
54 bundle = signature *prerequisite *reference LF pack
55 signature = "# v2 git bundle" LF
57 prerequisite = "\-" obj\-id SP comment LF
59 reference = obj\-id SP refname LF
61 pack = \&.\&.\&. ; packfile
68 A v3 bundle looks like this:
74 bundle = signature *capability *prerequisite *reference LF pack
75 signature = "# v3 git bundle" LF
77 capability = "@" key ["=" value] LF
78 prerequisite = "\-" obj\-id SP comment LF
80 reference = obj\-id SP refname LF
81 key = 1*(ALPHA / DIGIT / "\-")
82 value = *(%01\-09 / %0b\-FF)
84 pack = \&.\&.\&. ; packfile
92 A Git bundle consists of several parts\&.
102 "Capabilities", which are only in the v3 format, indicate functionality that the bundle requires to be read properly\&.
113 "Prerequisites" lists the objects that are NOT included in the bundle and the reader of the bundle MUST already have, in order to use the data in the bundle\&. The objects stored in the bundle may refer to prerequisite objects and anything reachable from them (e\&.g\&. a tree object in the bundle can reference a blob that is reachable from a prerequisite) and/or expressed as a delta against prerequisite objects\&.
124 "References" record the tips of the history graph, iow, what the reader of the bundle CAN "git fetch" from it\&.
135 "Pack" is the pack data stream "git fetch" would send, if you fetch from a repository that has the references recorded in the "References" above into a repository that has references pointing at the objects listed in "Prerequisites" above\&.
138 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\&.
139 .SS "Note on the shallow clone and a Git bundle"
141 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\&.
144 Because there is no opportunity for negotiation, unknown capabilities cause \fIgit bundle\fR to abort\&.
155 specifies the hash algorithm in use, and can take the same values as the
156 \fBextensions\&.objectFormat\fR
157 configuration value\&.
169 specifies an object filter as in the
172 \fBgit-rev-list\fR(1)\&. The resulting pack\-file must be marked as a
174 pack\-file after it is unbundled\&.
178 Part of the \fBgit\fR(1) suite