Skip to content

Bundle & Shallow Clone Quick Recipe

# Create full bundle for DR/offline
bundle file: repo-$(date +%Y%m%d).bundle
git bundle create repo.bundle --all

# Verify before transfer
git bundle verify repo.bundle

# Clone from bundle
bundle-to-clone: git clone repo.bundle ./workspace

# Shallow clone for CI speed
git clone --depth 50 --branch main https://git.internal/repo.git ./app

# Partial clone (monorepo, no blobs)
git clone --filter=blob:none https://git.internal/monorepo.git ./mono

# Sparse checkout + partial
cd ./mono && git sparse-checkout init --cone
cd ./mono && git sparse-checkout set src/app build/

# Extend shallow history
git fetch --depth 200
# Full history
git fetch --unshallow