title: How to git bundle a complete repo
body: <p>I need to transfer a complete repo to a new non-networked machine, preferable as a single file entity. The git bundle allows a <code>git fetch</code>, <code>git pull</code> style operation in a sneakernet environment but appears to assume that you already have a working version of the repo on the destination machine.</p>
  
  <p>What is the right invocation to:</p>
  
  <ol>
  <li>Bundle <em>all</em> the branches in the current repo</li>
  <li>Start up the new repo on the destination directory, i.e. get the root commit correctly installed</li>
  </ol>
  
  <hr>
  
  <p>I've sent a patch upstream to clarify:</p>
  
  <pre><code>`git clone` can use any bundle created without negative refspecs
  (e.g., `new`, but not `old..new`).
  If you want to match `git clone --mirror`, which would clone other
  refs such as `refs/remotes/*`, use `--all`.
  If you want to provide the same set of refs that a clone directly
  from the source repository would get, use `--branches --tags` for
  the `&lt;git-rev-list-args&gt;`.
  </code></pre>
  
  <p>So <code>$ git bundle create repo.bundle --branches --tags</code> best matches cloning.</p>
  
  <p><code>$ git bundle create repo.bundle --all</code> will provide a mirror image of your source machine, including it's remote refs.</p>