Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 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 7.0.2" /> |
| 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
| 19 | a { color: blue; } |
| 20 | a:visited { color: fuchsia; } |
| 21 | |
| 22 | em { |
| 23 | font-style: italic; |
| 24 | } |
| 25 | |
| 26 | strong { |
| 27 | font-weight: bold; |
| 28 | } |
| 29 | |
| 30 | tt { |
| 31 | color: navy; |
| 32 | } |
| 33 | |
| 34 | h1, 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 | |
| 42 | h1 { |
| 43 | border-bottom: 2px solid silver; |
| 44 | } |
| 45 | h2 { |
| 46 | border-bottom: 2px solid silver; |
| 47 | padding-top: 0.5em; |
| 48 | } |
| 49 | |
| 50 | div.sectionbody { |
| 51 | font-family: serif; |
| 52 | margin-left: 0; |
| 53 | } |
| 54 | |
| 55 | hr { |
| 56 | border: 1px solid silver; |
| 57 | } |
| 58 | |
| 59 | p { |
| 60 | margin-top: 0.5em; |
| 61 | margin-bottom: 0.5em; |
| 62 | } |
| 63 | |
| 64 | pre { |
| 65 | padding: 0; |
| 66 | margin: 0; |
| 67 | } |
| 68 | |
| 69 | span#author { |
| 70 | color: #527bbd; |
| 71 | font-family: sans-serif; |
| 72 | font-weight: bold; |
| 73 | font-size: 1.2em; |
| 74 | } |
| 75 | span#email { |
| 76 | } |
| 77 | span#revision { |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | |
| 81 | div#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 | } |
| 88 | div#footer-text { |
| 89 | float: left; |
| 90 | padding-bottom: 0.5em; |
| 91 | } |
| 92 | div#footer-badges { |
| 93 | float: right; |
| 94 | padding-bottom: 0.5em; |
| 95 | } |
| 96 | |
| 97 | div#preamble, |
| 98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 100 | div.admonitionblock { |
| 101 | margin-right: 10%; |
| 102 | margin-top: 1.5em; |
| 103 | margin-bottom: 1.5em; |
| 104 | } |
| 105 | div.admonitionblock { |
| 106 | margin-top: 2.5em; |
| 107 | margin-bottom: 2.5em; |
| 108 | } |
| 109 | |
| 110 | div.content { /* Block element content. */ |
| 111 | padding: 0; |
| 112 | } |
| 113 | |
| 114 | /* Block element titles. */ |
| 115 | div.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 | } |
| 122 | div.title + * { |
| 123 | margin-top: 0; |
| 124 | } |
| 125 | |
| 126 | td div.title:first-child { |
| 127 | margin-top: 0.0em; |
| 128 | } |
| 129 | div.content div.title:first-child { |
| 130 | margin-top: 0.0em; |
| 131 | } |
| 132 | div.content + div.title { |
| 133 | margin-top: 0.0em; |
| 134 | } |
| 135 | |
| 136 | div.sidebarblock > div.content { |
| 137 | background: #ffffee; |
| 138 | border: 1px solid silver; |
| 139 | padding: 0.5em; |
| 140 | } |
| 141 | |
| 142 | div.listingblock > div.content { |
| 143 | border: 1px solid silver; |
| 144 | background: #f4f4f4; |
| 145 | padding: 0.5em; |
| 146 | } |
| 147 | |
| 148 | div.quoteblock > div.content { |
| 149 | padding-left: 2.0em; |
| 150 | } |
| 151 | div.quoteblock .attribution { |
| 152 | text-align: right; |
| 153 | } |
| 154 | |
| 155 | div.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 | } |
| 163 | div.admonitionblock td.content { |
| 164 | padding-left: 0.5em; |
| 165 | border-left: 2px solid silver; |
| 166 | } |
| 167 | |
| 168 | div.exampleblock > div.content { |
| 169 | border-left: 2px solid silver; |
| 170 | padding: 0.5em; |
| 171 | } |
| 172 | |
| 173 | div.verseblock div.content { |
| 174 | white-space: pre; |
| 175 | } |
| 176 | |
| 177 | div.imageblock div.content { padding-left: 0; } |
| 178 | div.imageblock img { border: 1px solid silver; } |
| 179 | span.image img { border-style: none; } |
| 180 | |
| 181 | dl { |
| 182 | margin-top: 0.8em; |
| 183 | margin-bottom: 0.8em; |
| 184 | } |
| 185 | dt { |
| 186 | margin-top: 0.5em; |
| 187 | margin-bottom: 0; |
| 188 | font-style: italic; |
| 189 | } |
| 190 | dd > *:first-child { |
| 191 | margin-top: 0; |
| 192 | } |
| 193 | |
| 194 | ul, ol { |
| 195 | list-style-position: outside; |
| 196 | } |
| 197 | ol.olist2 { |
| 198 | list-style-type: lower-alpha; |
| 199 | } |
| 200 | |
| 201 | div.tableblock > table { |
| 202 | border-color: #527bbd; |
| 203 | border-width: 3px; |
| 204 | } |
| 205 | thead { |
| 206 | font-family: sans-serif; |
| 207 | font-weight: bold; |
| 208 | } |
| 209 | tfoot { |
| 210 | font-weight: bold; |
| 211 | } |
| 212 | |
| 213 | div.hlist { |
| 214 | margin-top: 0.8em; |
| 215 | margin-bottom: 0.8em; |
| 216 | } |
| 217 | td.hlist1 { |
| 218 | vertical-align: top; |
| 219 | font-style: italic; |
| 220 | padding-right: 0.8em; |
| 221 | } |
| 222 | td.hlist2 { |
| 223 | vertical-align: top; |
| 224 | } |
| 225 | |
| 226 | @media print { |
| 227 | div#footer-badges { display: none; } |
| 228 | } |
| 229 | include::./stylesheets/xhtml11-manpage.css[] |
| 230 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 231 | |
| 232 | div.sidebar-content { |
| 233 | background: #ffffee; |
| 234 | border: 1px solid silver; |
| 235 | padding: 0.5em; |
| 236 | } |
| 237 | div.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 | |
| 244 | div.listingblock div.content { |
| 245 | border: 1px solid silver; |
| 246 | background: #f4f4f4; |
| 247 | padding: 0.5em; |
| 248 | } |
| 249 | |
| 250 | div.quoteblock-content { |
| 251 | padding-left: 2.0em; |
| 252 | } |
| 253 | |
| 254 | div.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> |
| 264 | git-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 Hamano | a9b8d24 | 2007-05-19 04:51:55 | [diff] [blame] | 275 | <div class="verseblock"> |
| 276 | <div class="content"><em>git-bundle</em> create <file> [git-rev-list args] |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 277 | <em>git-bundle</em> verify <file> |
| 278 | <em>git-bundle</em> list-heads <file> [refname…] |
Junio C Hamano | a9b8d24 | 2007-05-19 04:51:55 | [diff] [blame] | 279 | <em>git-bundle</em> unbundle <file> [refname…]</div></div> |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 280 | </div> |
| 281 | <h2>DESCRIPTION</h2> |
| 282 | <div class="sectionbody"> |
| 283 | <p>Some workflows require that one or more branches of development on one |
| 284 | machine be replicated on another machine, but the two machines cannot |
| 285 | be directly connected so the interactive git protocols (git, ssh, |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 286 | rsync, http) cannot be used. This command provides support for |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 287 | git-fetch and git-pull to operate by packaging objects and references |
| 288 | in an archive at the originating machine, then importing those into |
| 289 | another repository using <a href="git-fetch.html">git-fetch(1)</a> and <a href="git-pull.html">git-pull(1)</a> |
| 290 | after moving the archive by some means (i.e., by sneakernet). As no |
| 291 | direct connection between repositories exists, the user must specify a |
| 292 | basis for the bundle that is held by the destination repository: the |
| 293 | bundle assumes that all objects in the basis are already in the |
| 294 | destination repository.</p> |
| 295 | </div> |
| 296 | <h2>OPTIONS</h2> |
| 297 | <div class="sectionbody"> |
| 298 | <dl> |
| 299 | <dt> |
| 300 | create <file> |
| 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> |
| 309 | verify <file> |
| 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> |
| 322 | list-heads <file> |
| 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> |
| 332 | unbundle <file> |
| 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…] |
| 346 | </dt> |
| 347 | <dd> |
| 348 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 349 | A list of arguments, acceptable to git-rev-parse and |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 350 | 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…] |
| 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 Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 365 | expects to receive only those references asked for and not |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 366 | 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 |
| 375 | git-show-ref: this includes heads, tags, and remote heads. References |
| 376 | such as master~1 cannot be packaged, but are perfectly suitable for |
| 377 | defining the basis. More than one reference may be packaged, and more |
| 378 | than one basis can be specified. The objects packaged are those not |
| 379 | contained in the union of the given bases. Each basis can be |
| 380 | specified explicitly (e.g., ^master~10), or implicitly (e.g., |
| 381 | master~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 Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 383 | It is okay to err on the side of conservatism, causing the bundle file |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 384 | to contain objects already in the destination as these are ignored |
| 385 | when 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. |
| 390 | For whatever reason, direct connection between A and B is not allowed, |
| 391 | but we can move data from A to B via some mechanism (CD, email, etc). |
Junio C Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 392 | We 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> |
| 397 | Without 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> |
| 409 | Using temporally tags. |
| 410 | </p> |
| 411 | <p>We set a tag in R1 (lastR2bundle) after the previous such transport, |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 412 | and move it afterwards to help build the bundle.</p> |
Junio C Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 413 | </li> |
| 414 | </ul> |
Junio C Hamano | 4fd58d4 | 2007-09-30 00:51:14 | [diff] [blame] | 415 | <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 Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 420 | <ul> |
| 421 | <li> |
| 422 | <p> |
| 423 | Using 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> |
| 434 | A 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> |
| 445 | With 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 Hamano | 4fd58d4 | 2007-09-30 00:51:14 | [diff] [blame] | 454 | <div class="listingblock"> |
| 455 | <div class="content"> |
| 456 | <pre><tt>$ git-bundle verify mybundle |
Junio C Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 457 | $ git-fetch mybundle master:localRef</tt></pre> |
Junio C Hamano | 4fd58d4 | 2007-09-30 00:51:14 | [diff] [blame] | 458 | </div></div> |
Junio C Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 459 | <p>With something like this in the config in R2:</p> |
| 460 | <div class="listingblock"> |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 461 | <div class="content"> |
Junio C Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 462 | <pre><tt>[remote "bundle"] |
| 463 | url = /home/me/tmp/file.bdl |
| 464 | fetch = refs/heads/*:refs/remotes/origin/*</tt></pre> |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 465 | </div></div> |
| 466 | <p>You can first sneakernet the bundle file to ~/tmp/file.bdl and |
Junio C Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 467 | then these commands on machine B:</p> |
Junio C Hamano | 4fd58d4 | 2007-09-30 00:51:14 | [diff] [blame] | 468 | <div class="listingblock"> |
| 469 | <div class="content"> |
| 470 | <pre><tt>$ git ls-remote bundle |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 471 | $ git fetch bundle |
Junio C Hamano | 4fd58d4 | 2007-09-30 00:51:14 | [diff] [blame] | 472 | $ git pull bundle</tt></pre> |
| 473 | </div></div> |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 474 | <p>would treat it as if it is talking with a remote side over the |
| 475 | network.</p> |
| 476 | </div> |
| 477 | <h2>Author</h2> |
| 478 | <div class="sectionbody"> |
| 479 | <p>Written by Mark Levedahl <mdl123@verizon.net></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 Hamano | 601f3e5 | 2008-02-25 08:40:42 | [diff] [blame] | 487 | Last updated 25-Feb-2008 08:40:21 UTC |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 488 | </div> |
| 489 | </div> |
| 490 | </body> |
| 491 | </html> |