Skip to content

Instantly share code, notes, and snippets.

@copyleftdev
Created May 25, 2026 20:21
Show Gist options
  • Select an option

  • Save copyleftdev/b21f345b9bf832270839e45bf0c9a659 to your computer and use it in GitHub Desktop.

Select an option

Save copyleftdev/b21f345b9bf832270839e45bf0c9a659 to your computer and use it in GitHub Desktop.
git bundle — pack an entire repo into a single portable file
# git bundle — the git sneakernet
# No network. Air-gapped machine. USB drive. It still works.
# Pack everything — every ref, every object:
git bundle create repo.bundle --all
# Verify the bundle is self-contained:
git bundle verify repo.bundle
# Clone from the bundle (it's a valid git remote):
git clone repo.bundle local-copy
# ── Delta bundle — only what's new ────────────────────────────
# Efficient sync: bundle only commits ahead of a known-good tag:
git bundle create delta.bundle main ^v2.3.0
# Apply on the other side:
git fetch delta.bundle main:main
# ── Common scenarios ──────────────────────────────────────────
# Full offline backup: git bundle create backup.bundle --all
# Sync air-gapped host: git bundle create delta.bundle main ^last-synced-tag
# Email a PR: git bundle create pr.bundle feature ^main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment