Autogenerated HTML docs for v1.6.3.2-316-gda4e
[git/jnareb-git.git] / git-bundle.html
blob97ecbcf6b1d6131972d060381612caad91f5b2d8
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">
4 <head>
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">
8 /* Debug borders */
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11 border: 1px solid red;
15 body {
16 margin: 1em 5% 1em 5%;
19 a {
20 color: blue;
21 text-decoration: underline;
23 a:visited {
24 color: fuchsia;
27 em {
28 font-style: italic;
31 strong {
32 font-weight: bold;
35 tt {
36 color: navy;
39 h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
47 h1, h2, h3 {
48 border-bottom: 2px solid silver;
50 h2 {
51 padding-top: 0.5em;
53 h3 {
54 float: left;
56 h3 + * {
57 clear: left;
60 div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
65 hr {
66 border: 1px solid silver;
69 p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
74 pre {
75 padding: 0;
76 margin: 0;
79 span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
83 font-size: 1.1em;
85 span#email {
87 span#revision {
88 font-family: sans-serif;
91 div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
98 div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
102 div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
107 div#preamble,
108 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110 div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
115 div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
120 div.content { /* Block element content. */
121 padding: 0;
124 /* Block element titles. */
125 div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
132 div.title + * {
133 margin-top: 0;
136 td div.title:first-child {
137 margin-top: 0.0em;
139 div.content div.title:first-child {
140 margin-top: 0.0em;
142 div.content + div.title {
143 margin-top: 0.0em;
146 div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
152 div.listingblock {
153 margin-right: 0%;
155 div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
161 div.quoteblock > div.content {
162 padding-left: 2.0em;
165 div.attribution {
166 text-align: right;
168 div.verseblock + div.attribution {
169 text-align: left;
172 div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
180 div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
185 div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
190 div.verseblock div.content {
191 white-space: pre;
194 div.imageblock div.content { padding-left: 0; }
195 div.imageblock img { border: 1px solid silver; }
196 span.image img { border-style: none; }
198 dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
202 dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
207 dd > *:first-child {
208 margin-top: 0;
211 ul, ol {
212 list-style-position: outside;
214 div.olist2 ol {
215 list-style-type: lower-alpha;
218 div.tableblock > table {
219 border: 3px solid #527bbd;
221 thead {
222 font-family: sans-serif;
223 font-weight: bold;
225 tfoot {
226 font-weight: bold;
229 div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
233 div.hlist td {
234 padding-bottom: 5px;
236 td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
241 td.hlist2 {
242 vertical-align: top;
245 @media print {
246 div#footer-badges { display: none; }
249 div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
258 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
262 div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
266 div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
270 div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
274 include1::./stylesheets/xhtml11-manpage.css[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
282 div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
289 div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
295 div.quoteblock-content {
296 padding-left: 2.0em;
299 div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc a:visited { color: blue; }
306 </style>
307 <title>git-bundle(1)</title>
308 </head>
309 <body>
310 <div id="header">
311 <h1>
312 git-bundle(1) Manual Page
313 </h1>
314 <h2>NAME</h2>
315 <div class="sectionbody">
316 <p>git-bundle -
317 Move objects and refs by archive
318 </p>
319 </div>
320 </div>
321 <h2>SYNOPSIS</h2>
322 <div class="sectionbody">
323 <div class="verseblock">
324 <div class="content"><em>git bundle</em> create &lt;file&gt; &lt;git-rev-list args&gt;
325 <em>git bundle</em> verify &lt;file&gt;
326 <em>git bundle</em> list-heads &lt;file&gt; [refname&#8230;]
327 <em>git bundle</em> unbundle &lt;file&gt; [refname&#8230;]</div></div>
328 </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>
343 </div>
344 <h2 id="_options">OPTIONS</h2>
345 <div class="sectionbody">
346 <div class="vlist"><dl>
347 <dt>
348 create &lt;file&gt;
349 </dt>
350 <dd>
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.
354 </p>
355 </dd>
356 <dt>
357 verify &lt;file&gt;
358 </dt>
359 <dd>
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.
367 </p>
368 </dd>
369 <dt>
370 list-heads &lt;file&gt;
371 </dt>
372 <dd>
374 Lists the references defined in the bundle. If followed by a
375 list of references, only references matching those given are
376 printed out.
377 </p>
378 </dd>
379 <dt>
380 unbundle &lt;file&gt;
381 </dt>
382 <dd>
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>.
389 </p>
390 </dd>
391 <dt>
392 [git-rev-list-args&#8230;]
393 </dt>
394 <dd>
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
402 packaged.
403 </p>
404 </dd>
405 <dt>
406 [refname&#8230;]
407 </dt>
408 <dd>
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>).
415 </p>
416 </dd>
417 </dl></div>
418 </div>
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>
433 </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>
450 </div></div>
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>
458 </div></div>
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>
467 </div></div>
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
470 updates.</p></div>
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>
478 </div></div>
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>
485 </div></div>
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>
496 </div></div>
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>
501 </div></div>
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>
506 </div></div>
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>
512 </div></div>
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>
521 </div></div>
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>
526 </div></div>
527 </div>
528 <h2 id="_author">Author</h2>
529 <div class="sectionbody">
530 <div class="para"><p>Written by Mark Levedahl &lt;mdl123@verizon.net&gt;</p></div>
531 </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>
535 </div>
536 <div id="footer">
537 <div id="footer-text">
538 Last updated 2009-04-02 06:49:45 UTC
539 </div>
540 </div>
541 </body>
542 </html>