blob: 0c0d4c61d8d0a6592f32873fc61d740ed7e95524 [file] [log] [blame]
Junio C Hamano6ac2f142007-03-01 01:24:561<!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 7.0.2" />
7<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-bundle(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-bundle(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-bundle -
269 Move objects and refs by archive
270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamanoa9b8d242007-05-19 04:51:55275<div class="verseblock">
276<div class="content"><em>git-bundle</em> create &lt;file&gt; [git-rev-list args]
Junio C Hamano6ac2f142007-03-01 01:24:56277<em>git-bundle</em> verify &lt;file&gt;
278<em>git-bundle</em> list-heads &lt;file&gt; [refname&#8230;]
Junio C Hamanoa9b8d242007-05-19 04:51:55279<em>git-bundle</em> unbundle &lt;file&gt; [refname&#8230;]</div></div>
Junio C Hamano6ac2f142007-03-01 01:24:56280</div>
281<h2>DESCRIPTION</h2>
282<div class="sectionbody">
283<p>Some workflows require that one or more branches of development on one
284machine be replicated on another machine, but the two machines cannot
285be directly connected so the interactive git protocols (git, ssh,
Junio C Hamanoa3fd83c2007-03-02 10:34:36286rsync, http) cannot be used. This command provides support for
Junio C Hamano6ac2f142007-03-01 01:24:56287git-fetch and git-pull to operate by packaging objects and references
288in an archive at the originating machine, then importing those into
289another repository using <a href="git-fetch.html">git-fetch(1)</a> and <a href="git-pull.html">git-pull(1)</a>
290after moving the archive by some means (i.e., by sneakernet). As no
291direct connection between repositories exists, the user must specify a
292basis for the bundle that is held by the destination repository: the
293bundle assumes that all objects in the basis are already in the
294destination repository.</p>
295</div>
296<h2>OPTIONS</h2>
297<div class="sectionbody">
298<dl>
299<dt>
300create &lt;file&gt;
301</dt>
302<dd>
303<p>
304 Used to create a bundle named <em>file</em>. This requires the
305 git-rev-list arguments to define the bundle contents.
306</p>
307</dd>
308<dt>
309verify &lt;file&gt;
310</dt>
311<dd>
312<p>
313 Used to check that a bundle file is valid and will apply
314 cleanly to the current repository. This includes checks on the
315 bundle format itself as well as checking that the prerequisite
316 commits exist and are fully linked in the current repository.
317 git-bundle prints a list of missing commits, if any, and exits
318 with non-zero status.
319</p>
320</dd>
321<dt>
322list-heads &lt;file&gt;
323</dt>
324<dd>
325<p>
326 Lists the references defined in the bundle. If followed by a
327 list of references, only references matching those given are
328 printed out.
329</p>
330</dd>
331<dt>
332unbundle &lt;file&gt;
333</dt>
334<dd>
335<p>
336 Passes the objects in the bundle to <a href="git-index-pack.html">git-index-pack(1)</a>
337 for storage in the repository, then prints the names of all
338 defined references. If a reflist is given, only references
339 matching those in the given list are printed. This command is
340 really plumbing, intended to be called only by
341 <a href="git-fetch.html">git-fetch(1)</a>.
342</p>
343</dd>
344<dt>
345[git-rev-list-args&#8230;]
346</dt>
347<dd>
348<p>
Junio C Hamanoa3fd83c2007-03-02 10:34:36349 A list of arguments, acceptable to git-rev-parse and
Junio C Hamano6ac2f142007-03-01 01:24:56350 git-rev-list, that specify the specific objects and references
351 to transport. For example, "master~10..master" causes the
352 current master reference to be packaged along with all objects
353 added since its 10th ancestor commit. There is no explicit
354 limit to the number of references and objects that may be
355 packaged.
356</p>
357</dd>
358<dt>
359[refname&#8230;]
360</dt>
361<dd>
362<p>
363 A list of references used to limit the references reported as
364 available. This is principally of use to git-fetch, which
Junio C Hamanoa3fd83c2007-03-02 10:34:36365 expects to receive only those references asked for and not
Junio C Hamano6ac2f142007-03-01 01:24:56366 necessarily everything in the pack (in this case, git-bundle is
367 acting like <a href="git-fetch-pack.html">git-fetch-pack(1)</a>).
368</p>
369</dd>
370</dl>
371</div>
372<h2>SPECIFYING REFERENCES</h2>
373<div class="sectionbody">
374<p>git-bundle will only package references that are shown by
375git-show-ref: this includes heads, tags, and remote heads. References
376such as master~1 cannot be packaged, but are perfectly suitable for
377defining the basis. More than one reference may be packaged, and more
378than one basis can be specified. The objects packaged are those not
379contained in the union of the given bases. Each basis can be
380specified explicitly (e.g., ^master~10), or implicitly (e.g.,
381master~10..master, master --since=10.days.ago).</p>
382<p>It is very important that the basis used be held by the destination.
Junio C Hamanoa3fd83c2007-03-02 10:34:36383It is okay to err on the side of conservatism, causing the bundle file
Junio C Hamano6ac2f142007-03-01 01:24:56384to contain objects already in the destination as these are ignored
385when unpacking at the destination.</p>
386</div>
387<h2>EXAMPLE</h2>
388<div class="sectionbody">
389<p>Assume two repositories exist as R1 on machine A, and R2 on machine B.
390For whatever reason, direct connection between A and B is not allowed,
391but we can move data from A to B via some mechanism (CD, email, etc).
Junio C Hamano601f3e52008-02-25 08:40:42392We want to update R2 with developments made on branch master in R1.</p>
393<p>To create the bundle you have to specify the basis. You have some options:</p>
394<ul>
395<li>
396<p>
397Without basis.
398</p>
399<p>This is useful when sending the whole history.</p>
400</li>
401</ul>
402<div class="listingblock">
403<div class="content">
404<pre><tt>$ git bundle create mybundle master</tt></pre>
405</div></div>
406<ul>
407<li>
408<p>
409Using temporally tags.
410</p>
411<p>We set a tag in R1 (lastR2bundle) after the previous such transport,
Junio C Hamano6ac2f142007-03-01 01:24:56412and move it afterwards to help build the bundle.</p>
Junio C Hamano601f3e52008-02-25 08:40:42413</li>
414</ul>
Junio C Hamano4fd58d42007-09-30 00:51:14415<div class="listingblock">
416<div class="content">
417<pre><tt>$ git-bundle create mybundle master ^lastR2bundle
418$ git tag -f lastR2bundle master</tt></pre>
419</div></div>
Junio C Hamano601f3e52008-02-25 08:40:42420<ul>
421<li>
422<p>
423Using a tag present in both repositories
424</p>
425</li>
426</ul>
427<div class="listingblock">
428<div class="content">
429<pre><tt>$ git bundle create mybundle master ^v1.0.0</tt></pre>
430</div></div>
431<ul>
432<li>
433<p>
434A basis based on time.
435</p>
436</li>
437</ul>
438<div class="listingblock">
439<div class="content">
440<pre><tt>$ git bundle create mybundle master --since=10.days.ago</tt></pre>
441</div></div>
442<ul>
443<li>
444<p>
445With a limit on the number of commits
446</p>
447</li>
448</ul>
449<div class="listingblock">
450<div class="content">
451<pre><tt>$ git bundle create mybundle master -n 10</tt></pre>
452</div></div>
453<p>Then you move mybundle from A to B, and in R2 on B:</p>
Junio C Hamano4fd58d42007-09-30 00:51:14454<div class="listingblock">
455<div class="content">
456<pre><tt>$ git-bundle verify mybundle
Junio C Hamano601f3e52008-02-25 08:40:42457$ git-fetch mybundle master:localRef</tt></pre>
Junio C Hamano4fd58d42007-09-30 00:51:14458</div></div>
Junio C Hamano601f3e52008-02-25 08:40:42459<p>With something like this in the config in R2:</p>
460<div class="listingblock">
Junio C Hamano6ac2f142007-03-01 01:24:56461<div class="content">
Junio C Hamano601f3e52008-02-25 08:40:42462<pre><tt>[remote "bundle"]
463 url = /home/me/tmp/file.bdl
464 fetch = refs/heads/*:refs/remotes/origin/*</tt></pre>
Junio C Hamano6ac2f142007-03-01 01:24:56465</div></div>
466<p>You can first sneakernet the bundle file to ~/tmp/file.bdl and
Junio C Hamano601f3e52008-02-25 08:40:42467then these commands on machine B:</p>
Junio C Hamano4fd58d42007-09-30 00:51:14468<div class="listingblock">
469<div class="content">
470<pre><tt>$ git ls-remote bundle
Junio C Hamano6ac2f142007-03-01 01:24:56471$ git fetch bundle
Junio C Hamano4fd58d42007-09-30 00:51:14472$ git pull bundle</tt></pre>
473</div></div>
Junio C Hamano6ac2f142007-03-01 01:24:56474<p>would treat it as if it is talking with a remote side over the
475network.</p>
476</div>
477<h2>Author</h2>
478<div class="sectionbody">
479<p>Written by Mark Levedahl &lt;mdl123@verizon.net&gt;</p>
480</div>
481<h2>GIT</h2>
482<div class="sectionbody">
483<p>Part of the <a href="git.html">git(7)</a> suite</p>
484</div>
485<div id="footer">
486<div id="footer-text">
Junio C Hamano601f3e52008-02-25 08:40:42487Last updated 25-Feb-2008 08:40:21 UTC
Junio C Hamano6ac2f142007-03-01 01:24:56488</div>
489</div>
490</body>
491</html>