]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/gitformat-bundle.txt
Merge branch 'jk/rebase-apply-leakfix'
[thirdparty/git.git] / Documentation / gitformat-bundle.txt
CommitLineData
844739ba
ÆAB
1gitformat-bundle(5)
2===================
7378ec90 3
844739ba
ÆAB
4NAME
5----
6gitformat-bundle - The bundle file format
7
8
9SYNOPSIS
10--------
11[verse]
12*.bundle
13*.bdl
14
15DESCRIPTION
16-----------
17
18The Git bundle format is a format that represents both refs and Git
19objects. A bundle is a header in a format similar to
20linkgit:git-show-ref[1] followed by a pack in *.pack format.
7378ec90 21
844739ba
ÆAB
22The format is created and read by the linkgit:git-bundle[1] command,
23and supported by e.g. linkgit:git-fetch[1] and linkgit:git-clone[1].
24
25
26FORMAT
27------
7378ec90
MS
28
29We will use ABNF notation to define the Git bundle format. See
5db92105 30linkgit:gitprotocol-common[5] for the details.
7378ec90 31
c5aecfc8 32A v2 bundle looks like this:
33
7378ec90
MS
34----
35bundle = signature *prerequisite *reference LF pack
36signature = "# v2 git bundle" LF
37
38prerequisite = "-" obj-id SP comment LF
39comment = *CHAR
40reference = obj-id SP refname LF
41
42pack = ... ; packfile
43----
44
c5aecfc8 45A v3 bundle looks like this:
46
47----
48bundle = signature *capability *prerequisite *reference LF pack
49signature = "# v3 git bundle" LF
50
51capability = "@" key ["=" value] LF
52prerequisite = "-" obj-id SP comment LF
53comment = *CHAR
54reference = obj-id SP refname LF
55key = 1*(ALPHA / DIGIT / "-")
56value = *(%01-09 / %0b-FF)
57
58pack = ... ; packfile
59----
60
844739ba
ÆAB
61
62SEMANTICS
63---------
7378ec90 64
c5aecfc8 65A Git bundle consists of several parts.
66
67* "Capabilities", which are only in the v3 format, indicate functionality that
68 the bundle requires to be read properly.
7378ec90 69
ce14cc0b 70* "Prerequisites" list the objects that are NOT included in the bundle and the
7378ec90
MS
71 reader of the bundle MUST already have, in order to use the data in the
72 bundle. The objects stored in the bundle may refer to prerequisite objects and
73 anything reachable from them (e.g. a tree object in the bundle can reference
74 a blob that is reachable from a prerequisite) and/or expressed as a delta
75 against prerequisite objects.
76
77* "References" record the tips of the history graph, iow, what the reader of the
78 bundle CAN "git fetch" from it.
79
80* "Pack" is the pack data stream "git fetch" would send, if you fetch from a
81 repository that has the references recorded in the "References" above into a
82 repository that has references pointing at the objects listed in
83 "Prerequisites" above.
84
85In the bundle format, there can be a comment following a prerequisite obj-id.
86This is a comment and it has no specific meaning. The writer of the bundle MAY
87put any string here. The reader of the bundle MUST ignore the comment.
88
cf6cac20
EN
89Note on shallow clones and Git bundles
90~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7378ec90 91
cf6cac20 92Note that the prerequisites do not represent a shallow-clone boundary. The
7378ec90
MS
93semantics of the prerequisites and the shallow-clone boundaries are different,
94and the Git bundle v2 format cannot represent a shallow clone repository.
c5aecfc8 95
844739ba
ÆAB
96CAPABILITIES
97------------
c5aecfc8 98
99Because there is no opportunity for negotiation, unknown capabilities cause 'git
105c6f14
DS
100bundle' to abort.
101
102* `object-format` specifies the hash algorithm in use, and can take the same
103 values as the `extensions.objectFormat` configuration value.
104
105* `filter` specifies an object filter as in the `--filter` option in
106 linkgit:git-rev-list[1]. The resulting pack-file must be marked as a
107 `.promisor` pack-file after it is unbundled.
844739ba
ÆAB
108
109GIT
110---
111Part of the linkgit:git[1] suite