Git Bundle
In one line
git bundle packs commits and refs into a single binary file that can be cloned or fetched from, useful offline.
In simple words
git bundle creates a single file containing Git objects (commits, trees, blobs) and refs, which can be used as a source for git clone or git fetch. It is a way to transport repository data without a network connection — you can move a bundle on a USB stick and clone from it.
You create a bundle with git bundle create repo.bundle main, which packs everything reachable from the main branch. You can bundle a range (git bundle create update.bundle main..feature) to send only new commits. The receiver verifies with git bundle verify and then fetches or clones from the bundle file path.
Use cases: offline collaboration (ship code via physical media), creating a backup snapshot, transferring a repo through an air-gapped network, and sending a branch to a colleague when you cannot push to a shared remote. Bundles are self-contained and portable.
Example
# On machine A — create a bundle of the main branch
git bundle create repo.bundle main
# Copy repo.bundle to a USB stick or email
# On machine B — verify and clone from the bundle
git bundle verify repo.bundle
git clone repo.bundle my-project
# Send only new commits since the last bundle
git bundle create update.bundle old-main..main
# Receiver fetches the update
git fetch update.bundle main:maincreate packs objects into a file. verify checks the bundle is valid and has the needed prerequisites. clone/fetch treat the bundle file as a remote.
Related terms
Related Resources
Related Lessons
- Git Advanced
Learn git bundle.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.