diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/git/gitformat-bundle.html | |
new repository
Diffstat (limited to 'devdocs/git/gitformat-bundle.html')
| -rw-r--r-- | devdocs/git/gitformat-bundle.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/devdocs/git/gitformat-bundle.html b/devdocs/git/gitformat-bundle.html new file mode 100644 index 00000000..4d6cd2a5 --- /dev/null +++ b/devdocs/git/gitformat-bundle.html @@ -0,0 +1,25 @@ +<h1>gitformat-bundle</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>gitformat-bundle - The bundle file format</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content">*.bundle +*.bdl</pre> </div> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <p>The Git bundle format is a format that represents both refs and Git objects. A bundle is a header in a format similar to <a href="git-show-ref">git-show-ref[1]</a> followed by a pack in *.pack format.</p> <p>The format is created and read by the <a href="git-bundle">git-bundle[1]</a> command, and supported by e.g. <a href="git-fetch">git-fetch[1]</a> and <a href="git-clone">git-clone[1]</a>.</p> </div> <h2 id="_format">Format</h2> <div class="sectionbody"> <p>We will use ABNF notation to define the Git bundle format. See <a href="gitprotocol-common">gitprotocol-common[5]</a> for the details.</p> <p>A v2 bundle looks like this:</p> <div class="listingblock"> <div class="content"> <pre>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</pre> </div> </div> <p>A v3 bundle looks like this:</p> <div class="listingblock"> <div class="content"> <pre>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</pre> </div> </div> </div> <h2 id="_semantics">Semantics</h2> <div class="sectionbody"> <p>A Git bundle consists of several parts.</p> <div class="ulist"> <ul> <li> <p>"Capabilities", which are only in the v3 format, indicate functionality that the bundle requires to be read properly.</p> </li> <li> <p>"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.</p> </li> <li> <p>"References" record the tips of the history graph, iow, what the reader of the bundle CAN "git fetch" from it.</p> </li> <li> <p>"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.</p> </li> </ul> </div> <p>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.</p> <div class="sect2"> <h3 id="_note_on_shallow_clones_and_git_bundles"> +Note on shallow clones and Git bundles</h3> <p>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.</p> </div> </div> <h2 id="_capabilities">Capabilities</h2> <div class="sectionbody"> <p>Because there is no opportunity for negotiation, unknown capabilities cause <code>git bundle</code> to abort.</p> <div class="ulist"> <ul> <li> <p><code>object-format</code> specifies the hash algorithm in use, and can take the same values as the <code>extensions.objectFormat</code> configuration value.</p> </li> <li> <p><code>filter</code> specifies an object filter as in the <code>--filter</code> option in <a href="git-rev-list">git-rev-list[1]</a>. The resulting pack-file must be marked as a <code>.promisor</code> pack-file after it is unbundled.</p> </li> </ul> </div> </div><div class="_attribution"> + <p class="_attribution-p"> + © 2012–2024 Scott Chacon and others<br>Licensed under the MIT License.<br> + <a href="https://git-scm.com/docs/gitformat-bundle" class="_attribution-link">https://git-scm.com/docs/gitformat-bundle</a> + </p> +</div> |
