Sign In

git bundle unbundle <path>

List or apply the refs contained in a Git bundle file into the current repository.

This command inspects a bundle file and optionally imports the refs it contains into your current repository, making it useful for offline transfer or backup of branches and tags without needing direct network access.

This command reads the bundle located at <path> (for example my-repo.bundle) and either prints the refs (such as branches and tags) stored in the bundle or, when used together with other git fetch-style options, imports those refs into your current repository; by default, without extra options, it behaves like a dry-run listing that shows what would be fetched from the bundle. The <path> argument is the location of the bundle file, which can be created earlier with git bundle create. You can combine this with flags like --quiet (or -q) to suppress non-error output while unbundling, or use refspecs (for example git bundle unbundle my-repo.bundle 'refs/heads/main:refs/heads/main') to control exactly which refs are updated.

You can think of this as a local, file-based alternative to git fetch, especially handy when you need to move commits between machines via USB, email, or shared storage: instead of fetching from a remote URL, Git reads from the bundle file and updates your branches accordingly, provided the current repo already has the necessary prerequisite commits recorded in the bundle metadata. Closely related commands include git bundle create (to generate the bundle in the first place) and git fetch <path-to-bundle> which also reads from a bundle but uses the more familiar fetch syntax, while git ls-remote <path-to-bundle> lets you list available refs in the bundle without attempting to import them.

Examples:

  • git bundle unbundle repo-backup.bundle
  • git bundle unbundle /tmp/offline-transfer.bundle
  • git bundle unbundle /media/usb/repo.bundle 'refs/heads/main:refs/heads/main'
Manual page
git bundle
Related commands

Sign in to Git Examples