Skip to content

Commit 9ab80dd

Browse files
avargitster
authored andcommitted
bundle doc: elaborate on object prerequisites
Split out the discussion bout "object prerequisites" into its own section, and add some more examples of the common cases. See 2e0afaf (Add git-bundle: move objects and references by archive, 2007-02-22) for the introduction of the documentation being changed here. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c8273d commit 9ab80dd

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

Documentation/git-bundle.txt

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ header indicating what references are contained within the bundle.
4444

4545
Like the the packed archive format itself bundles can either be
4646
self-contained, or be created using exclusions.
47+
See the "OBJECT PREREQUISITES" section below.
4748

4849
Bundles created using revision exclusions are "thin packs" created
4950
using the `--thin` option to linkgit:git-pack-objects[1], and
@@ -152,19 +153,49 @@ contained in the union of the given bases. Each basis can be
152153
specified explicitly (e.g. `^master~10`), or implicitly (e.g.
153154
`master~10..master`, `--since=10.days.ago master`).
154155

155-
It is very important that the basis used be held by the destination.
156+
OBJECT PREREQUISITES
157+
--------------------
158+
159+
When creating bundles it is possible to create a self-contained bundle
160+
that can be unbundled in a repository with no common history, as well
161+
as providing negative revisions to exclude objects needed in the
162+
earlier parts of the history.
163+
164+
Feeding a revision such as `new` to `git bundle create` will create a
165+
bundle file that contains all the objects reachable from the revision
166+
`new`. That bundle can be unbundled in any repository to obtain a full
167+
history that leads to the revision `new`:
168+
169+
----------------
170+
$ git bundle create full.bundle new
171+
----------------
172+
173+
A revision range such as `old..new` will produce a bundle file that
174+
will require the revision `old` (and any objects reachable from it)
175+
to exist for the bundle to be "unbundle"-able:
176+
177+
----------------
178+
$ git bundle create full.bundle old..new
179+
----------------
180+
181+
A self-contained bundle without any prerequisites can be extracted
182+
into anywhere, even into an empty repository, or be cloned from
183+
(i.e., `new`, but not `old..new`).
184+
156185
It is okay to err on the side of caution, causing the bundle file
157186
to contain objects already in the destination, as these are ignored
158187
when unpacking at the destination.
159188

160-
`git clone` can use any bundle created without negative refspecs
161-
(e.g., `new`, but not `old..new`).
162189
If you want to match `git clone --mirror`, which would include your
163190
refs such as `refs/remotes/*`, use `--all`.
164191
If you want to provide the same set of refs that a clone directly
165192
from the source repository would get, use `--branches --tags` for
166193
the `<git-rev-list-args>`.
167194

195+
The 'git bundle verify' command can be used to check whether your
196+
recipient repository has the required prerequisite commits for a
197+
bundle.
198+
168199
EXAMPLES
169200
--------
170201

0 commit comments

Comments
 (0)