2 .\" Title: gitformat-bundle
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.46.1.565.g6531f31ef3
10 .TH "GITFORMAT\-BUNDLE" "5" "2024-09-18" "Git 2\&.46\&.1\&.565\&.g6531f3" "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
40 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\&.
42 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)\&.
45 We will use ABNF notation to define the Git bundle format\&. See \fBgitprotocol-common\fR(5) for the details\&.
47 A v2 bundle looks like this:
53 bundle = signature *prerequisite *reference LF pack
54 signature = "# v2 git bundle" LF
56 prerequisite = "\-" obj\-id SP comment LF
58 reference = obj\-id SP refname LF
60 pack = \&.\&.\&. ; packfile
66 A v3 bundle looks like this:
72 bundle = signature *capability *prerequisite *reference LF pack
73 signature = "# v3 git bundle" LF
75 capability = "@" key ["=" value] LF
76 prerequisite = "\-" obj\-id SP comment LF
78 reference = obj\-id SP refname LF
79 key = 1*(ALPHA / DIGIT / "\-")
80 value = *(%01\-09 / %0b\-FF)
82 pack = \&.\&.\&. ; packfile
89 A Git bundle consists of several parts\&.
99 "Capabilities", which are only in the v3 format, indicate functionality that the bundle requires to be read properly\&.
110 "Prerequisites" list 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\&.
121 "References" record the tips of the history graph, iow, what the reader of the bundle CAN "git fetch" from it\&.
132 "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\&.
135 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\&.
136 .SS "Note on shallow clones and Git bundles"
138 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\&.
141 Because there is no opportunity for negotiation, unknown capabilities cause \fIgit bundle\fR to abort\&.
152 specifies the hash algorithm in use, and can take the same values as the
153 \fBextensions\&.objectFormat\fR
154 configuration value\&.
166 specifies an object filter as in the
169 \fBgit-rev-list\fR(1)\&. The resulting pack\-file must be marked as a
171 pack\-file after it is unbundled\&.
175 Part of the \fBgit\fR(1) suite