1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.2.5" />
7 <style type=
"text/css">
9 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
11 border: 1px solid red;
16 margin: 1em 5% 1em 5%;
21 text-decoration: underline
;
39 h1
, h2
, h3
, h4
, h5
, h6
{
41 font-family: sans-serif
;
48 border-bottom: 2px solid silver
;
66 border: 1px solid silver
;
81 font-family: sans-serif
;
88 font-family: sans-serif
;
92 font-family: sans-serif
;
94 border-top: 2px solid silver
;
100 padding-bottom: 0.5em;
104 padding-bottom: 0.5em;
108 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
109 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
110 div
.admonitionblock
{
113 margin-bottom: 1.5em;
115 div
.admonitionblock
{
117 margin-bottom: 2.5em;
120 div
.content
{ /* Block element content. */
124 /* Block element titles. */
125 div
.title
, caption
.title
{
126 font-family: sans-serif
;
130 margin-bottom: 0.5em;
136 td div
.title:first-child
{
139 div
.content div
.title:first-child
{
142 div
.content
+ div
.title
{
146 div
.sidebarblock
> div
.content
{
148 border: 1px solid silver
;
155 div
.listingblock
> div
.content
{
156 border: 1px solid silver
;
161 div
.quoteblock
> div
.content
{
168 div
.verseblock
+ div
.attribution
{
172 div
.admonitionblock
.icon
{
176 text-decoration: underline
;
178 padding-right: 0.5em;
180 div
.admonitionblock td
.content
{
182 border-left: 2px solid silver
;
185 div
.exampleblock
> div
.content
{
186 border-left: 2px solid silver
;
190 div
.verseblock div
.content
{
194 div
.imageblock div
.content
{ padding-left: 0; }
195 div
.imageblock img
{ border: 1px solid silver
; }
196 span
.image img
{ border-style: none
; }
200 margin-bottom: 0.8em;
212 list-style-position: outside
;
215 list-style-type: lower-alpha
;
218 div
.tableblock
> table
{
219 border: 3px solid
#527bbd;
222 font-family: sans-serif
;
231 margin-bottom: 0.8em;
239 padding-right: 0.8em;
246 div#footer-badges
{ display: none
; }
251 font-family: sans-serif
;
255 margin-bottom: 0.1em;
258 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
274 include1::./stylesheets
/xhtml11-manpage
.css
[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div
.sidebar-content
{
279 border: 1px solid silver
;
282 div
.sidebar-title
, div
.image-title
{
283 font-family: sans-serif
;
286 margin-bottom: 0.5em;
289 div
.listingblock div
.content
{
290 border: 1px solid silver
;
295 div
.quoteblock-content
{
299 div
.exampleblock-content
{
300 border-left: 2px solid silver
;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc
a:visited
{ color: blue
; }
307 <title>git-bundle(
1)
</title>
312 git-bundle(
1) Manual Page
315 <div class=
"sectionbody">
317 Move objects and refs by archive
322 <div class=
"sectionbody">
323 <div class=
"verseblock">
324 <div class=
"content"><em>git bundle
</em> create
<file
> <git-rev-list args
>
325 <em>git bundle
</em> verify
<file
>
326 <em>git bundle
</em> list-heads
<file
> [refname
…]
327 <em>git bundle
</em> unbundle
<file
> [refname
…]
</div></div>
329 <h2 id=
"_description">DESCRIPTION
</h2>
330 <div class=
"sectionbody">
331 <div class=
"para"><p>Some workflows require that one or more branches of development on one
332 machine be replicated on another machine, but the two machines cannot
333 be directly connected, and therefore the interactive git protocols (git,
334 ssh, rsync, http) cannot be used. This command provides support for
335 <em>git-fetch
</em> and
<em>git-pull
</em> to operate by packaging objects and references
336 in an archive at the originating machine, then importing those into
337 another repository using
<em>git-fetch
</em> and
<em>git-pull
</em>
338 after moving the archive by some means (i.e., by sneakernet). As no
339 direct connection between the repositories exists, the user must specify a
340 basis for the bundle that is held by the destination repository: the
341 bundle assumes that all objects in the basis are already in the
342 destination repository.
</p></div>
344 <h2 id=
"_options">OPTIONS
</h2>
345 <div class=
"sectionbody">
346 <div class=
"vlist"><dl>
352 Used to create a bundle named
<em>file
</em>. This requires the
353 <em>git-rev-list
</em> arguments to define the bundle contents.
361 Used to check that a bundle file is valid and will apply
362 cleanly to the current repository. This includes checks on the
363 bundle format itself as well as checking that the prerequisite
364 commits exist and are fully linked in the current repository.
365 <em>git-bundle
</em> prints a list of missing commits, if any, and exits
366 with a non-zero status.
370 list-heads
<file
>
374 Lists the references defined in the bundle. If followed by a
375 list of references, only references matching those given are
380 unbundle
<file
>
384 Passes the objects in the bundle to
<em>git-index-pack
</em>
385 for storage in the repository, then prints the names of all
386 defined references. If a list of references is given, only
387 references matching those in the list are printed. This command is
388 really plumbing, intended to be called only by
<em>git-fetch
</em>.
392 [git-rev-list-args
…]
396 A list of arguments, acceptable to
<em>git-rev-parse
</em> and
397 <em>git-rev-list
</em>, that specifies the specific objects and references
398 to transport. For example,
<tt>master\~
10..master
</tt> causes the
399 current master reference to be packaged along with all objects
400 added since its
10th ancestor commit. There is no explicit
401 limit to the number of references and objects that may be
410 A list of references used to limit the references reported as
411 available. This is principally of use to
<em>git-fetch
</em>, which
412 expects to receive only those references asked for and not
413 necessarily everything in the pack (in this case,
<em>git-bundle
</em> acts
414 like
<em>git-fetch-pack
</em>).
419 <h2 id=
"_specifying_references">SPECIFYING REFERENCES
</h2>
420 <div class=
"sectionbody">
421 <div class=
"para"><p><em>git-bundle
</em> will only package references that are shown by
422 <em>git-show-ref
</em>: this includes heads, tags, and remote heads. References
423 such as
<tt>master\~
1</tt> cannot be packaged, but are perfectly suitable for
424 defining the basis. More than one reference may be packaged, and more
425 than one basis can be specified. The objects packaged are those not
426 contained in the union of the given bases. Each basis can be
427 specified explicitly (e.g.
<tt>^master\~
10</tt>), or implicitly (e.g.
428 <tt>master\~
10..master
</tt>,
<tt>--since=
10.days.ago master
</tt>).
</p></div>
429 <div class=
"para"><p>It is very important that the basis used be held by the destination.
430 It is okay to err on the side of caution, causing the bundle file
431 to contain objects already in the destination, as these are ignored
432 when unpacking at the destination.
</p></div>
434 <h2 id=
"_example">EXAMPLE
</h2>
435 <div class=
"sectionbody">
436 <div class=
"para"><p>Assume you want to transfer the history from a repository R1 on machine A
437 to another repository R2 on machine B.
438 For whatever reason, direct connection between A and B is not allowed,
439 but we can move data from A to B via some mechanism (CD, email, etc.).
440 We want to update R2 with development made on the branch master in R1.
</p></div>
441 <div class=
"para"><p>To bootstrap the process, you can first create a bundle that does not have
442 any basis. You can use a tag to remember up to what commit you last
443 processed, in order to make it easy to later update the other repository
444 with an incremental bundle:
</p></div>
445 <div class=
"listingblock">
446 <div class=
"content">
447 <pre><tt>machineA$ cd R1
448 machineA$ git bundle create file.bundle master
449 machineA$ git tag -f lastR2bundle master
</tt></pre>
451 <div class=
"para"><p>Then you transfer file.bundle to the target machine B. If you are creating
452 the repository on machine B, then you can clone from the bundle as if it
453 were a remote repository instead of creating an empty repository and then
454 pulling or fetching objects from the bundle:
</p></div>
455 <div class=
"listingblock">
456 <div class=
"content">
457 <pre><tt>machineB$ git clone /home/me/tmp/file.bundle R2
</tt></pre>
459 <div class=
"para"><p>This will define a remote called
"origin" in the resulting repository that
460 lets you fetch and pull from the bundle. The $GIT_DIR/config file in R2 will
461 have an entry like this:
</p></div>
462 <div class=
"listingblock">
463 <div class=
"content">
464 <pre><tt>[remote
"origin"]
465 url = /home/me/tmp/file.bundle
466 fetch = refs/heads/*:refs/remotes/origin/*
</tt></pre>
468 <div class=
"para"><p>To update the resulting mine.git repository, you can fetch or pull after
469 replacing the bundle stored at /home/me/tmp/file.bundle with incremental
471 <div class=
"para"><p>After working some more in the original repository, you can create an
472 incremental bundle to update the other repository:
</p></div>
473 <div class=
"listingblock">
474 <div class=
"content">
475 <pre><tt>machineA$ cd R1
476 machineA$ git bundle create file.bundle lastR2bundle..master
477 machineA$ git tag -f lastR2bundle master
</tt></pre>
479 <div class=
"para"><p>You then transfer the bundle to the other machine to replace
480 /home/me/tmp/file.bundle, and pull from it.
</p></div>
481 <div class=
"listingblock">
482 <div class=
"content">
483 <pre><tt>machineB$ cd R2
484 machineB$ git pull
</tt></pre>
486 <div class=
"para"><p>If you know up to what commit the intended recipient repository should
487 have the necessary objects, you can use that knowledge to specify the
488 basis, giving a cut-off point to limit the revisions and objects that go
489 in the resulting bundle. The previous example used lastR2bundle tag
490 for this purpose, but you can use any other options that you would give to
491 the
<a href=
"git-log.html">git-log(
1)
</a> command. Here are more examples:
</p></div>
492 <div class=
"para"><p>You can use a tag that is present in both:
</p></div>
493 <div class=
"listingblock">
494 <div class=
"content">
495 <pre><tt>$ git bundle create mybundle v1.0
.0..master
</tt></pre>
497 <div class=
"para"><p>You can use a basis based on time:
</p></div>
498 <div class=
"listingblock">
499 <div class=
"content">
500 <pre><tt>$ git bundle create mybundle --since=
10.days master
</tt></pre>
502 <div class=
"para"><p>You can use the number of commits:
</p></div>
503 <div class=
"listingblock">
504 <div class=
"content">
505 <pre><tt>$ git bundle create mybundle -
10 master
</tt></pre>
507 <div class=
"para"><p>You can run
<tt>git-bundle verify
</tt> to see if you can extract from a bundle
508 that was created with a basis:
</p></div>
509 <div class=
"listingblock">
510 <div class=
"content">
511 <pre><tt>$ git bundle verify mybundle
</tt></pre>
513 <div class=
"para"><p>This will list what commits you must have in order to extract from the
514 bundle and will error out if you do not have them.
</p></div>
515 <div class=
"para"><p>A bundle from a recipient repository's point of view is just like a
516 regular repository which it fetches or pulls from. You can, for example, map
517 references when fetching:
</p></div>
518 <div class=
"listingblock">
519 <div class=
"content">
520 <pre><tt>$ git fetch mybundle master:localRef
</tt></pre>
522 <div class=
"para"><p>You can also see what references it offers.
</p></div>
523 <div class=
"listingblock">
524 <div class=
"content">
525 <pre><tt>$ git ls-remote mybundle
</tt></pre>
528 <h2 id=
"_author">Author
</h2>
529 <div class=
"sectionbody">
530 <div class=
"para"><p>Written by Mark Levedahl
<mdl123@verizon.net
></p></div>
532 <h2 id=
"_git">GIT
</h2>
533 <div class=
"sectionbody">
534 <div class=
"para"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
537 <div id=
"footer-text">
538 Last updated
2009-
07-
01 02:
30:
43 UTC