CINXE.COM
Git - git-bundle Documentation
<!DOCTYPE html> <html lang="en"> <head> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Git - git-bundle Documentation</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> </head> <body id="documentation"> <div class="inner"> <header> <a href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" /></a> <span id="tagline"></span> <script type="text/javascript"> const taglines = [ "fast-version-control", "everything-is-local", "distributed-even-if-your-workflow-isnt", "local-branching-on-the-cheap", "distributed-is-the-new-centralized" ]; var tagline = taglines[Math.floor(Math.random() * taglines.length)]; document.getElementById('tagline').innerHTML = '--' + tagline; </script> <form id="search" action="/search/results"> <input id="search-text" name="search" placeholder="Type / to search entire site…" autocomplete="off" type="text" /> </form> <div id="search-results"></div> </header> </div> <div class="inner"> <div id="content-wrapper"> <div tabindex="1" class="sidebar-btn"></div> <aside class="sidebar" id="sidebar"> <nav> <ul> <li> <a href="/about">About</a> <ul> </ul> </li> <li> <a href="/doc" class="active">Documentation</a> <ul class="expanded"> <li> <a href="/docs" class="active">Reference</a> </li> <li> <a href="/book">Book</a> </li> <li> <a href="/videos">Videos</a> </li> <li> <a href="/doc/ext">External Links</a> </li> </ul> </li> <li> <a href="/downloads">Downloads</a> <ul > <li> <a href="/downloads/guis">GUI Clients</a> </li> <li> <a href="/downloads/logos">Logos</a> </li> </ul> </li> <li> <a href="/community">Community</a> </li> </ul> </nav> </aside> <div id="content"> <div id='reference-version'> <a class="dropdown-trigger" id="reference-languages-trigger" data-panel-id="l10n-versions-dropdown" href="#"> English ▾</a> <div class='dropdown-panel right' id='l10n-versions-dropdown'> <header>Localized versions of <strong>git-bundle</strong> manual</header> <ol class='reference-previous-versions'> <li> <a href="/docs/git-bundle"><span class="version">English</span> </a> </li> <li> <a href="/docs/git-bundle/fr"><span class="version">Français</span> </a> </li> <li> <a href="/docs/git-bundle/pt_BR"><span class="version">Português (Brasil)</span> </a> </li> <li> <a href="/docs/git-bundle/zh_HANS-CN"><span class="version">简体中文</span> </a> </li> </ol> <footer> Want to read in your language or fix typos?<br/> <a href="https://github.com/jnavila/git-manpages-l10n">You can help translate this page</a>. </footer> </div> <a class="dropdown-trigger" id="reference-topics-trigger" data-panel-id="topics-dropdown" href="#">Topics ▾</a> <div class='dropdown-panel right' id='topics-dropdown'> <div class='three-column'> <div class='column-left'> <h3 class='setup'>Setup and Config</h3> <ul class='unstyled'> <li> <a href="/docs/git"> git </a> </li> <li> <a href="/docs/git-config"> config </a> </li> <li> <a href="/docs/git-help"> help </a> </li> <li> <a href="/docs/git-bugreport"> bugreport </a> </li> <li> <a href="/doc/credential-helpers"> Credential helpers </a> </li> </ul> <h3 class='projects'>Getting and Creating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-init"> init </a> </li> <li> <a href="/docs/git-clone"> clone </a> </li> </ul> <h3 class='snapshotting'>Basic Snapshotting</h3> <ul class='unstyled'> <li> <a href="/docs/git-add"> add </a> </li> <li> <a href="/docs/git-status"> status </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-commit"> commit </a> </li> <li> <a href="/docs/git-notes"> notes </a> </li> <li> <a href="/docs/git-restore"> restore </a> </li> <li> <a href="/docs/git-reset"> reset </a> </li> <li> <a href="/docs/git-rm"> rm </a> </li> <li> <a href="/docs/git-mv"> mv </a> </li> </ul> <h3 class='branching'>Branching and Merging</h3> <ul class='unstyled'> <li> <a href="/docs/git-branch"> branch </a> </li> <li> <a href="/docs/git-checkout"> checkout </a> </li> <li> <a href="/docs/git-switch"> switch </a> </li> <li> <a href="/docs/git-merge"> merge </a> </li> <li> <a href="/docs/git-mergetool"> mergetool </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-stash"> stash </a> </li> <li> <a href="/docs/git-tag"> tag </a> </li> <li> <a href="/docs/git-worktree"> worktree </a> </li> </ul> <h3 class='sharing'>Sharing and Updating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-fetch"> fetch </a> </li> <li> <a href="/docs/git-pull"> pull </a> </li> <li> <a href="/docs/git-push"> push </a> </li> <li> <a href="/docs/git-remote"> remote </a> </li> <li> <a href="/docs/git-submodule"> submodule </a> </li> </ul> </div> <div class='column-middle'> <h3 class='inspection'>Inspection and Comparison</h3> <ul class='unstyled'> <li> <a href="/docs/git-show"> show </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-difftool"> difftool </a> </li> <li> <a href="/docs/git-range-diff"> range-diff </a> </li> <li> <a href="/docs/git-shortlog"> shortlog </a> </li> <li> <a href="/docs/git-describe"> describe </a> </li> </ul> <h3 class='patching'>Patching</h3> <ul class='unstyled'> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-cherry-pick"> cherry-pick </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-rebase"> rebase </a> </li> <li> <a href="/docs/git-revert"> revert </a> </li> </ul> <h3 class='debugging'>Debugging</h3> <ul class='unstyled'> <li> <a href="/docs/git-bisect"> bisect </a> </li> <li> <a href="/docs/git-blame"> blame </a> </li> <li> <a href="/docs/git-grep"> grep </a> </li> </ul> <h3 class='email'>Email</h3> <ul class='unstyled'> <li> <a href="/docs/git-am"> am </a> </li> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-format-patch"> format-patch </a> </li> <li> <a href="/docs/git-send-email"> send-email </a> </li> <li> <a href="/docs/git-request-pull"> request-pull </a> </li> </ul> <h3 class='external'>External Systems</h3> <ul class='unstyled'> <li> <a href="/docs/git-svn"> svn </a> </li> <li> <a href="/docs/git-fast-import"> fast-import </a> </li> </ul> <h3 class='server-admin'>Server Admin</h3> <ul class='unstyled'> <li> <a href="/docs/git-daemon"> daemon </a> </li> <li> <a href="/docs/git-update-server-info"> update-server-info </a> </li> </ul> </div> <div class='column-right'> <h3 class='guides'>Guides</h3> <ul class='unstyled'> <li> <a href="/docs/gitattributes"> gitattributes </a> </li> <li> <a href="/docs/gitcli"> Command-line interface conventions </a> </li> <li> <a href="/docs/giteveryday"> Everyday Git </a> </li> <li> <a href="/docs/gitfaq"> Frequently Asked Questions (FAQ) </a> </li> <li> <a href="/docs/gitglossary"> Glossary </a> </li> <li> <a href="/docs/githooks"> Hooks </a> </li> <li> <a href="/docs/gitignore"> gitignore </a> </li> <li> <a href="/docs/gitmodules"> gitmodules </a> </li> <li> <a href="/docs/gitrevisions"> Revisions </a> </li> <li> <a href="/docs/gitsubmodules"> Submodules </a> </li> <li> <a href="/docs/gittutorial"> Tutorial </a> </li> <li> <a href="/docs/gitworkflows"> Workflows </a> </li> <li> <a href="/docs/git#_guides"> All guides... </a> </li> </ul> <h3 class='admin'>Administration</h3> <ul class='unstyled'> <li> <a href="/docs/git-clean"> clean </a> </li> <li> <a href="/docs/git-gc"> gc </a> </li> <li> <a href="/docs/git-fsck"> fsck </a> </li> <li> <a href="/docs/git-reflog"> reflog </a> </li> <li> <a href="/docs/git-filter-branch"> filter-branch </a> </li> <li> <a href="/docs/git-instaweb"> instaweb </a> </li> <li> <a href="/docs/git-archive"> archive </a> </li> <li> <a href="/docs/git-bundle"> bundle </a> </li> </ul> <h3 class='plumbing'>Plumbing Commands</h3> <ul class='unstyled'> <li> <a href="/docs/git-cat-file"> cat-file </a> </li> <li> <a href="/docs/git-check-ignore"> check-ignore </a> </li> <li> <a href="/docs/git-checkout-index"> checkout-index </a> </li> <li> <a href="/docs/git-commit-tree"> commit-tree </a> </li> <li> <a href="/docs/git-count-objects"> count-objects </a> </li> <li> <a href="/docs/git-diff-index"> diff-index </a> </li> <li> <a href="/docs/git-for-each-ref"> for-each-ref </a> </li> <li> <a href="/docs/git-hash-object"> hash-object </a> </li> <li> <a href="/docs/git-ls-files"> ls-files </a> </li> <li> <a href="/docs/git-ls-tree"> ls-tree </a> </li> <li> <a href="/docs/git-merge-base"> merge-base </a> </li> <li> <a href="/docs/git-read-tree"> read-tree </a> </li> <li> <a href="/docs/git-rev-list"> rev-list </a> </li> <li> <a href="/docs/git-rev-parse"> rev-parse </a> </li> <li> <a href="/docs/git-show-ref"> show-ref </a> </li> <li> <a href="/docs/git-symbolic-ref"> symbolic-ref </a> </li> <li> <a href="/docs/git-update-index"> update-index </a> </li> <li> <a href="/docs/git-update-ref"> update-ref </a> </li> <li> <a href="/docs/git-verify-pack"> verify-pack </a> </li> <li> <a href="/docs/git-write-tree"> write-tree </a> </li> </ul> </div> </div> </div> <a class="dropdown-trigger" id="reference-versions-trigger" data-panel-id="previous-versions-dropdown" href="#"> Latest version ▾ </a> <span class="light d-flex">git-bundle last updated in 2.41.0</span> <div class='dropdown-panel left' id='previous-versions-dropdown'> <header>Changes in the <strong>git-bundle</strong> manual</header> <ol class='reference-previous-versions'> <li class="no-change"><span>2.41.1 → 2.47.1 no changes</span></li> <li> <a href="/docs/git-bundle/2.41.0"><span class="version">2.41.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">06/01/23</em> </a> </li> <li class="no-change"><span>2.38.1 → 2.40.3 no changes</span></li> <li> <a href="/docs/git-bundle/2.38.0"><span class="version">2.38.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">10/02/22</em> </a> </li> <li class="no-change"><span>2.36.1 → 2.37.7 no changes</span></li> <li> <a href="/docs/git-bundle/2.36.0"><span class="version">2.36.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">04/18/22</em> </a> </li> <li class="no-change"><span>2.34.1 → 2.35.8 no changes</span></li> <li> <a href="/docs/git-bundle/2.34.0"><span class="version">2.34.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">11/15/21</em> </a> </li> <li class="no-change"><span>2.33.2 → 2.33.8 no changes</span></li> <li> <a href="/docs/git-bundle/2.33.1"><span class="version">2.33.1</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">10/12/21</em> </a> </li> <li class="no-change"><span>2.29.1 → 2.33.0 no changes</span></li> <li> <a href="/docs/git-bundle/2.29.0"><span class="version">2.29.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">10/19/20</em> </a> </li> <li class="no-change"><span>2.25.1 → 2.28.1 no changes</span></li> <li> <a href="/docs/git-bundle/2.25.0"><span class="version">2.25.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">01/13/20</em> </a> </li> <li class="no-change"><span>2.18.1 → 2.24.4 no changes</span></li> <li> <a href="/docs/git-bundle/2.18.0"><span class="version">2.18.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">06/21/18</em> </a> </li> <li class="no-change"><span>2.9.5 → 2.17.6 no changes</span></li> <li> <a href="/docs/git-bundle/2.8.6"><span class="version">2.8.6</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">07/30/17</em> </a> </li> <li class="no-change"><span>2.1.4 → 2.7.6 no changes</span></li> <li> <a href="/docs/git-bundle/2.0.5"><span class="version">2.0.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">12/17/14</em> </a> </li> <li> </li> </ol> <footer> <p>Check your version of git by running</p> <code class="command">git --version</code> </footer> </div> </div> <div id="main" data-pagefind-filter="category:reference" data-pagefind-meta="category:Reference" data-pagefind-weight="0.05" data-pagefind-body> <div class="sect1"> <h2 id="_name"><a class="anchor" href="#_name"></a>NAME</h2> <div class="sectionbody"> <div class="paragraph"> <p>git-bundle - Move objects and refs by archive</p> </div> </div> </div> <div class="sect1"> <h2 id="_synopsis"><a class="anchor" href="#_synopsis"></a>SYNOPSIS</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content"><em>git bundle</em> create [-q | --quiet | --progress] [--version=<version>] <file> <git-rev-list-args> <em>git bundle</em> verify [-q | --quiet] <file> <em>git bundle</em> list-heads <file> [<refname>…​] <em>git bundle</em> unbundle [--progress] <file> [<refname>…​]</pre> </div> </div> </div> <div class="sect1"> <h2 id="_description"><a class="anchor" href="#_description"></a>DESCRIPTION</h2> <div class="sectionbody"> <div class="paragraph"> <p>Create, unpack, and manipulate "bundle" files. Bundles are used for the "offline" transfer of Git objects without an active "server" sitting on the other side of the network connection.</p> </div> <div class="paragraph"> <p>They can be used to create both incremental and full backups of a repository, and to relay the state of the references in one repository to another.</p> </div> <div class="paragraph"> <p>Git commands that fetch or otherwise "read" via protocols such as <code>ssh://</code> and <code>https://</code> can also operate on bundle files. It is possible <a href='/docs/git-clone'>git-clone[1]</a> a new repository from a bundle, to use <a href='/docs/git-fetch'>git-fetch[1]</a> to fetch from one, and to list the references contained within it with <a href='/docs/git-ls-remote'>git-ls-remote[1]</a>. There’s no corresponding "write" support, i.e.a <em>git push</em> into a bundle is not supported.</p> </div> <div class="paragraph"> <p>See the "EXAMPLES" section below for examples of how to use bundles.</p> </div> </div> </div> <div class="sect1"> <h2 id="_bundle_format"><a class="anchor" href="#_bundle_format"></a>BUNDLE FORMAT</h2> <div class="sectionbody"> <div class="paragraph"> <p>Bundles are <code>.pack</code> files (see <a href='/docs/git-pack-objects'>git-pack-objects[1]</a>) with a header indicating what references are contained within the bundle.</p> </div> <div class="paragraph"> <p>Like the packed archive format itself bundles can either be self-contained, or be created using exclusions. See the "OBJECT PREREQUISITES" section below.</p> </div> <div class="paragraph"> <p>Bundles created using revision exclusions are "thin packs" created using the <code>--thin</code> option to <a href='/docs/git-pack-objects'>git-pack-objects[1]</a>, and unbundled using the <code>--fix-thin</code> option to <a href='/docs/git-index-pack'>git-index-pack[1]</a>.</p> </div> <div class="paragraph"> <p>There is no option to create a "thick pack" when using revision exclusions, and users should not be concerned about the difference. By using "thin packs", bundles created using exclusions are smaller in size. That they’re "thin" under the hood is merely noted here as a curiosity, and as a reference to other documentation.</p> </div> <div class="paragraph"> <p>See <a href='/docs/gitformat-bundle'>gitformat-bundle[5]</a> for more details and the discussion of "thin pack" in <a href='/docs/gitformat-pack'>gitformat-pack[5]</a> for further details.</p> </div> </div> </div> <div class="sect1"> <h2 id="_options"><a class="anchor" href="#_options"></a>OPTIONS</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-bundle.txt-createoptionsltfilegtltgit-rev-list-argsgt"> <a class="anchor" href="#Documentation/git-bundle.txt-createoptionsltfilegtltgit-rev-list-argsgt"></a>create [options] <file> <git-rev-list-args> </dt> <dd> <p>Used to create a bundle named <em>file</em>. This requires the <em><git-rev-list-args></em> arguments to define the bundle contents. <em>options</em> contains the options specific to the <em>git bundle create</em> subcommand. If <em>file</em> is <code>-</code>, the bundle is written to stdout.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt-verifyltfilegt"> <a class="anchor" href="#Documentation/git-bundle.txt-verifyltfilegt"></a>verify <file> </dt> <dd> <p>Used to check that a bundle file is valid and will apply cleanly to the current repository. This includes checks on the bundle format itself as well as checking that the prerequisite commits exist and are fully linked in the current repository. Then, <em>git bundle</em> prints a list of missing commits, if any. Finally, information about additional capabilities, such as "object filter", is printed. See "Capabilities" in <a href='/docs/gitformat-bundle'>gitformat-bundle[5]</a> for more information. The exit code is zero for success, but will be nonzero if the bundle file is invalid. If <em>file</em> is <code>-</code>, the bundle is read from stdin.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt-list-headsltfilegt"> <a class="anchor" href="#Documentation/git-bundle.txt-list-headsltfilegt"></a>list-heads <file> </dt> <dd> <p>Lists the references defined in the bundle. If followed by a list of references, only references matching those given are printed out. If <em>file</em> is <code>-</code>, the bundle is read from stdin.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt-unbundleltfilegt"> <a class="anchor" href="#Documentation/git-bundle.txt-unbundleltfilegt"></a>unbundle <file> </dt> <dd> <p>Passes the objects in the bundle to <em>git index-pack</em> for storage in the repository, then prints the names of all defined references. If a list of references is given, only references matching those in the list are printed. This command is really plumbing, intended to be called only by <em>git fetch</em>. If <em>file</em> is <code>-</code>, the bundle is read from stdin.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt-ltgit-rev-list-argsgt"> <a class="anchor" href="#Documentation/git-bundle.txt-ltgit-rev-list-argsgt"></a><git-rev-list-args> </dt> <dd> <p>A list of arguments, acceptable to <em>git rev-parse</em> and <em>git rev-list</em> (and containing a named ref, see SPECIFYING REFERENCES below), that specifies the specific objects and references to transport. For example, <code>master~10..master</code> causes the current master reference to be packaged along with all objects added since its 10th ancestor commit. There is no explicit limit to the number of references and objects that may be packaged.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt-ltrefnamegt82308203"> <a class="anchor" href="#Documentation/git-bundle.txt-ltrefnamegt82308203"></a>[<refname>…​] </dt> <dd> <p>A list of references used to limit the references reported as available. This is principally of use to <em>git fetch</em>, which expects to receive only those references asked for and not necessarily everything in the pack (in this case, <em>git bundle</em> acts like <em>git fetch-pack</em>).</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt---progress"> <a class="anchor" href="#Documentation/git-bundle.txt---progress"></a>--progress </dt> <dd> <p>Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt---versionltversiongt"> <a class="anchor" href="#Documentation/git-bundle.txt---versionltversiongt"></a>--version=<version> </dt> <dd> <p>Specify the bundle version. Version 2 is the older format and can only be used with SHA-1 repositories; the newer version 3 contains capabilities that permit extensions. The default is the oldest supported format, based on the hash algorithm in use.</p> </dd> <dt class="hdlist1" id="Documentation/git-bundle.txt--q"> <a class="anchor" href="#Documentation/git-bundle.txt--q"></a>-q </dt> <dt class="hdlist1" id="Documentation/git-bundle.txt---quiet"> <a class="anchor" href="#Documentation/git-bundle.txt---quiet"></a>--quiet </dt> <dd> <p>This flag makes the command not to report its progress on the standard error stream.</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_specifying_references"><a class="anchor" href="#_specifying_references"></a>SPECIFYING REFERENCES</h2> <div class="sectionbody"> <div class="paragraph"> <p>Revisions must be accompanied by reference names to be packaged in a bundle.</p> </div> <div class="paragraph"> <p>More than one reference may be packaged, and more than one set of prerequisite objects can be specified. The objects packaged are those not contained in the union of the prerequisites.</p> </div> <div class="paragraph"> <p>The <em>git bundle create</em> command resolves the reference names for you using the same rules as <code>git rev-parse --abbrev-ref=loose</code>. Each prerequisite can be specified explicitly (e.g. <code>^master~10</code>), or implicitly (e.g. <code>master~10..master</code>, <code>--since=10.days.ago master</code>).</p> </div> <div class="paragraph"> <p>All of these simple cases are OK (assuming we have a "master" and "next" branch):</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create master.bundle master $ echo master | git bundle create master.bundle --stdin $ git bundle create master-and-next.bundle master next $ (echo master; echo next) | git bundle create master-and-next.bundle --stdin</pre> </div> </div> <div class="paragraph"> <p>And so are these (and the same but omitted <code>--stdin</code> examples):</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create recent-master.bundle master~10..master $ git bundle create recent-updates.bundle master~10..master next~5..next</pre> </div> </div> <div class="paragraph"> <p>A revision name or a range whose right-hand-side cannot be resolved to a reference is not accepted:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create HEAD.bundle $(git rev-parse HEAD) fatal: Refusing to create empty bundle. $ git bundle create master-yesterday.bundle master~10..master~5 fatal: Refusing to create empty bundle.</pre> </div> </div> </div> </div> <div class="sect1"> <h2 id="_object_prerequisites"><a class="anchor" href="#_object_prerequisites"></a>OBJECT PREREQUISITES</h2> <div class="sectionbody"> <div class="paragraph"> <p>When creating bundles it is possible to create a self-contained bundle that can be unbundled in a repository with no common history, as well as providing negative revisions to exclude objects needed in the earlier parts of the history.</p> </div> <div class="paragraph"> <p>Feeding a revision such as <code>new</code> to <code>git bundle create</code> will create a bundle file that contains all the objects reachable from the revision <code>new</code>. That bundle can be unbundled in any repository to obtain a full history that leads to the revision <code>new</code>:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create full.bundle new</pre> </div> </div> <div class="paragraph"> <p>A revision range such as <code>old..new</code> will produce a bundle file that will require the revision <code>old</code> (and any objects reachable from it) to exist for the bundle to be "unbundle"-able:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create full.bundle old..new</pre> </div> </div> <div class="paragraph"> <p>A self-contained bundle without any prerequisites can be extracted into anywhere, even into an empty repository, or be cloned from (i.e., <code>new</code>, but not <code>old..new</code>).</p> </div> <div class="paragraph"> <p>It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination.</p> </div> <div class="paragraph"> <p>If you want to match <code>git clone --mirror</code>, which would include your refs such as <code>refs/remotes/*</code>, use <code>--all</code>. If you want to provide the same set of refs that a clone directly from the source repository would get, use <code>--branches --tags</code> for the <code><git-rev-list-args></code>.</p> </div> <div class="paragraph"> <p>The <em>git bundle verify</em> command can be used to check whether your recipient repository has the required prerequisite commits for a bundle.</p> </div> </div> </div> <div class="sect1"> <h2 id="_examples"><a class="anchor" href="#_examples"></a>EXAMPLES</h2> <div class="sectionbody"> <div class="paragraph"> <p>Assume you want to transfer the history from a repository R1 on machine A to another repository R2 on machine B. For whatever reason, direct connection between A and B is not allowed, but we can move data from A to B via some mechanism (CD, email, etc.). We want to update R2 with development made on the branch master in R1.</p> </div> <div class="paragraph"> <p>To bootstrap the process, you can first create a bundle that does not have any prerequisites. You can use a tag to remember up to what commit you last processed, in order to make it easy to later update the other repository with an incremental bundle:</p> </div> <div class="listingblock"> <div class="content"> <pre>machineA$ cd R1 machineA$ git bundle create file.bundle master machineA$ git tag -f lastR2bundle master</pre> </div> </div> <div class="paragraph"> <p>Then you transfer file.bundle to the target machine B. Because this bundle does not require any existing object to be extracted, you can create a new repository on machine B by cloning from it:</p> </div> <div class="listingblock"> <div class="content"> <pre>machineB$ git clone -b master /home/me/tmp/file.bundle R2</pre> </div> </div> <div class="paragraph"> <p>This will define a remote called "origin" in the resulting repository that lets you fetch and pull from the bundle. The $GIT_DIR/config file in R2 will have an entry like this:</p> </div> <div class="listingblock"> <div class="content"> <pre>[remote "origin"] url = /home/me/tmp/file.bundle fetch = refs/heads/*:refs/remotes/origin/*</pre> </div> </div> <div class="paragraph"> <p>To update the resulting mine.git repository, you can fetch or pull after replacing the bundle stored at /home/me/tmp/file.bundle with incremental updates.</p> </div> <div class="paragraph"> <p>After working some more in the original repository, you can create an incremental bundle to update the other repository:</p> </div> <div class="listingblock"> <div class="content"> <pre>machineA$ cd R1 machineA$ git bundle create file.bundle lastR2bundle..master machineA$ git tag -f lastR2bundle master</pre> </div> </div> <div class="paragraph"> <p>You then transfer the bundle to the other machine to replace /home/me/tmp/file.bundle, and pull from it.</p> </div> <div class="listingblock"> <div class="content"> <pre>machineB$ cd R2 machineB$ git pull</pre> </div> </div> <div class="paragraph"> <p>If you know up to what commit the intended recipient repository should have the necessary objects, you can use that knowledge to specify the prerequisites, giving a cut-off point to limit the revisions and objects that go in the resulting bundle. The previous example used the lastR2bundle tag for this purpose, but you can use any other options that you would give to the <a href='/docs/git-log'>git-log[1]</a> command. Here are more examples:</p> </div> <div class="paragraph"> <p>You can use a tag that is present in both:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create mybundle v1.0.0..master</pre> </div> </div> <div class="paragraph"> <p>You can use a prerequisite based on time:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create mybundle --since=10.days master</pre> </div> </div> <div class="paragraph"> <p>You can use the number of commits:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle create mybundle -10 master</pre> </div> </div> <div class="paragraph"> <p>You can run <code>git-bundle verify</code> to see if you can extract from a bundle that was created with a prerequisite:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git bundle verify mybundle</pre> </div> </div> <div class="paragraph"> <p>This will list what commits you must have in order to extract from the bundle and will error out if you do not have them.</p> </div> <div class="paragraph"> <p>A bundle from a recipient repository’s point of view is just like a regular repository which it fetches or pulls from. You can, for example, map references when fetching:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git fetch mybundle master:localRef</pre> </div> </div> <div class="paragraph"> <p>You can also see what references it offers:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git ls-remote mybundle</pre> </div> </div> </div> </div> <div class="sect1"> <h2 id="_file_format"><a class="anchor" href="#_file_format"></a>FILE FORMAT</h2> <div class="sectionbody"> <div class="paragraph"> <p>See <a href='/docs/gitformat-bundle'>gitformat-bundle[5]</a>.</p> </div> </div> </div> <div class="sect1"> <h2 id="_git"><a class="anchor" href="#_git"></a>GIT</h2> <div class="sectionbody"> <div class="paragraph"> <p>Part of the <a href='/docs/git'>git[1]</a> suite</p> </div> </div> </div> <h3 hidden="true" data-pagefind-weight="10">bundle</h3> </div> </div> </div> <footer> <div class="site-source"> <a href="/site">About this site</a><br> Patches, suggestions, and comments are welcome. </div> <div class="sfc-member"> Git is a member of <a href="/sfc">Software Freedom Conservancy</a> </div> </footer> <a href="#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top"> <img src="/images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/> </a> <script src="/js/jquery-1.7.1.min.js"></script> <script src="/js/jquery-ui-1.8.18.custom.min.js"></script> <script src="/js/jquery.defaultvalue.js"></script> <script src="/js/session.min.js"></script> <script src="/js/application.min.js"></script> </div> </body> </html>