Skip to content

bundle Git Command Guide

The git bundle command creates archives (bundles) of Git objects to transfer repositories or updates without network access. Bundles can be used to clone from, push to, or pull from remote repositories offline.

Terminal window
git bundle create <file> <let>..<ref>
git bundle verify <file>
git bundle list-heads <file> [<refs>...]
git bundle unbundle <file> [<refs>...]
CommandDescription
createCreate a bundle file
verifyCheck if bundle is valid
list-headsList references in bundle
unbundleExtract objects from bundle
ParameterDescription
Bundle file to create, verify, or read from
..Range of commits to include in bundle
Terminal window
git bundle create repo.bundle HEAD~10..HEAD

Creates a bundle with the last 10 commits.

Terminal window
git clone repo.bundle repo-copy

Clones a new repository from the bundle file.

Terminal window
git bundle verify repo.bundle

Checks if the bundle is valid and complete.

Terminal window
git bundle list-heads repo.bundle

Shows the references contained in the bundle.

Terminal window
git bundle unbundle repo.bundle

Extracts objects from bundle into the Git object database.

To create a bundle, use:

Terminal window
git bundle create <bundle-file> <ref>

To clone from a bundle, run:

Terminal window
git clone <bundle-file> <directory>

To verify a bundle file, execute:

Terminal window
git bundle verify <bundle-file>

To list references in a bundle, use:

Terminal window
git bundle list-heads <bundle-file>

To unbundle objects into the current repository, run:

Terminal window
git bundle unbundle <bundle-file>
  1. Creating offline repository backups for transfer
  2. Distributing Git repositories without network access
  3. Sharing repository snapshots over removable media
  4. Cloning repositories from archived bundles
  5. Verifying bundle integrity before use