An incremental Git bundle can be valid at the sender and unusable at the receiver because the receiver lacks its prerequisite history. Verify the bundle in the repository that will consume it, then import its reference into a review namespace before deciding whether to advance a working branch.
The exercise below uses PowerShell, Git 2.45 or later, and three synthetic local repositories. No network service is involved. A bundle transfers selected Git objects and references; it does not preserve unfinished working files, index edits, or every external dependency needed to build the project.
Decide which history should cross the boundary
The Git bundle manual describes self-contained bundles and bundles with prerequisite commits. A named branch without revision exclusions can carry the history reachable from that branch. A bounded range can omit older history on the assumption that the receiver already has it.
Choose that boundary deliberately. A branch can reach old file contents that are no longer present in its latest tree. A transfer intended to share today's sources may therefore disclose more historical material than a source archive. Review the selected history and use an approved transport. Bundle verification checks structural applicability, not the sender's trustworthiness or the confidentiality of the archive.
Do not describe a bundle as a complete workstation backup. Uncommitted work and local operational configuration have separate lifetimes. Submodule repositories and externally stored large-file payloads also need their own availability checks. The receiver's ability to inspect a commit is different from its ability to assemble the full development environment.
Establish a self-contained baseline
In a new empty parent directory, create a source repository and one committed file:
git init -b main bundle-source
Set-Location bundle-source
git config user.name "Example Author"
git config user.email "author@example.com"
Set-Content -LiteralPath note.txt -Encoding ascii -Value 'baseline'
git add -- note.txt
git commit -m "Create baseline"
git tag baseline
git bundle create ../baseline.bundle main
git bundle verify ../baseline.bundle
Set-Location ..
git clone -b main ./baseline.bundle bundle-receiver
The clone creates a receiver with the baseline history. In a real transfer, move the bundle through the approved medium and compare its identity using an independently trusted release or transfer record. A checksum transported beside an attacker-replaceable bundle does not establish who produced it; see the artifact evidence guide.
List the offered references before accepting a real delivery, and compare their names and object identities with the transfer request. An archive containing an unexpected branch is a scope discrepancy even if its object structure verifies successfully.
Inspect the receiver's current branch and contents before planning an update. Its baseline commit is now a useful prerequisite precisely because it exists there, not merely because the sender has a tag with that name.
Demonstrate the missing-prerequisite failure
Add one source commit and export only the history after the baseline:
Set-Location bundle-source
Set-Content -LiteralPath note.txt -Encoding ascii -Value 'updated'
git add -- note.txt
git commit -m "Update note"
git bundle create ../update.bundle baseline..main
Set-Location ..
git init -b main bundle-empty
git -C bundle-empty bundle verify ../update.bundle
The final command should exit unsuccessfully and report a missing prerequisite. That failure is expected; stop rather than running subsequent steps as if verification succeeded. The empty repository has no baseline commit. The same incremental file can pass in the prepared receiver because applicability depends on receiver state.
Verify and fetch from that prepared repository:
git -C bundle-receiver bundle verify ../update.bundle
git -C bundle-receiver fetch ../update.bundle main:refs/remotes/offline/main
git -C bundle-receiver log --oneline main..refs/remotes/offline/main
git -C bundle-receiver show refs/remotes/offline/main:note.txt
git -C bundle-receiver show main:note.txt
The incoming reference exposes the update, while main still shows the baseline. Fetch imported objects and updated the explicitly named remote-tracking reference; it did not replace the checked-out files. Keeping those states separate gives the receiver a review opportunity before integration.
Recover by supplying history rather than overriding checks
When prerequisites are missing, provide a self-contained baseline or a larger incremental bundle whose prerequisites the receiver actually has. Recreating a tag with the right spelling is insufficient if the corresponding commit object and its required ancestry are absent. Record the prerequisite commit identity in the transfer manifest.
If the receiver has diverged, review that divergence using normal Git integration rules. Do not force an incoming reference onto the working branch simply because transport succeeded. Preserve the receiver's work and inspect both histories. Integration can still conflict even when bundle verification passes, since verification does not test the business meaning of the combined changes.
For repeat transfers, acknowledge the receiver's successfully imported commit before using it as the next cutoff. An assumed delivery can break the next incremental update after lost media, an interrupted import, or a receiver rebuild. Retain a known self-contained recovery bundle according to the project's data policy.
Leave the synthetic directories before cleaning them up, and verify the intended targets. For a real offline exchange, finish with two separate records: which object identities were imported and which reviewed commit, if any, became the working branch tip. That distinction makes an incomplete transfer recoverable without claiming that received history has already been accepted.
Was this guide useful?
Your rating helps us prioritize clearer, more practical technical content.
Review diffs, run checks, and prepare the release in Arezgit.
Keep Git review, security scanning, API checks, database inspection, and release preparation together in one local desktop application.
Explore Arezgit