How to git bundle a complete repo

What is the right invocation to:

  • Bundle all the branches in the current repo

Simple:

$ git bundle create repo.bundle --all

Here repo.bundle is the name of bundle file you want to create. Note that --all would not include remote-tracking branches… just like ordinary clone wouldn’t either.

  • Start up the new repo on the destination directory, i.e. get the root commit correctly installed

First, clone is just init + fetch (+ administrativia).

Second, you can use bundle file everywhere the repository URL can be used, so you can simply clone from a bundle file:

$ git clone repo.bundle

This would create repo as a git repository.

Leave a Comment