---
title: "Hand over a Git branch as a file when the receiver has no remote | Proofline"
description: "Use git bundle when the receiver cannot reach your remote."
url: https://proofline.sh/learn/git-bundle-branch-handoff/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# Hand over a Git branch as a file when the receiver has no remote

Use git bundle when the receiver cannot reach your remote. Before you send the file, decide whether it should carry the whole history or only the commits the receiver lacks, because a bundle of a range is useless to someone without its base.

Deployment failures The Proofline team November 24, 2026 3 min read

## What goes wrong

A range bundle records the commits it assumes the receiver has. Git calls them prerequisites. In this fixture, `topic` is one commit on top of `main`, whose last two commits are `c2` and `c3`:

```
git bundle create topic.bundle main~1..topic
git bundle verify topic.bundle
```

In a full clone of `main`, `verify` prints the ref the bundle contains and the commit it requires, and exits 0. In a clone made with `--depth 1`, and in an empty repository, it prints:

```
error: Repository lacks these prerequisite commits:
error: 087208efc4e3006538adc8f4f5d03e8fe84b9026
```

and exits 1. Cloning straight from that file fails for the same reason, with exit 128. The shallow clone is the case that surprises people: its user has the repository and the branch tip checked out, and still lacks the commit the bundle needs. Git 2.43 produced these results. The [`git bundle` manual](https://git-scm.com/docs/git-bundle) describes both forms.

## Choose the range

| Receiver has | Create | Cost |
| --- | --- | --- |
| Nothing | `git bundle create all.bundle --all` | Every reachable object, so every branch and tag goes with it |
| Nothing, and needs one branch | `git bundle create topic.bundle topic` | That branch's whole history |
| A full clone that holds a commit you can name | `git bundle create topic.bundle BASE..topic` | Only the new commits |
| A shallow clone | One of the first two | A range needs history the clone may not hold |

Ask the receiver for `git rev-parse origin/main` and `git rev-parse --is-shallow-repository` before you build a range. Two lines of text are cheaper than a second file transfer.

Check `--all` before it leaves your organization. It carries branches nobody mentioned, and a file deleted in the latest commit is still in the history.

## Write the handoff

1.  The bundle's name and its `sha256sum`.
2.  The output of `git bundle list-heads topic.bundle`.
3.  The prerequisite commit, or "self-contained".
4.  The command to import it: `git fetch topic.bundle topic:topic`.

The receiver runs `git bundle verify`, fetches, and compares `git rev-parse topic` with the head you listed. The two match only if they have the same commit, and a commit names its tree and its whole ancestry.

## What a verified bundle does not show

`verify` checks the format and the prerequisites. It says nothing about files Git does not track, about submodules, whose commits live in another repository, or about Git LFS, where the history holds only pointers. If the project uses either, hand those over separately and name them in the message.

## Worked example

This example is fictional. A contractor's network blocks the code host, so Ana sends `fix.bundle`, built as `main..fix`. Verification fails on a prerequisite. The contractor's copy turns out to be a source archive committed into a new repository, so its history shares no commit with Ana's. A bundle cannot help with a range there. Ana sends a self-contained bundle of `fix`, and the contractor clones from it and rebuilds their two local commits on top as patches.

When you send a few commits for someone to apply on their own base, [patches with a recorded base](/learn/git-format-patch-base-commit/) are the smaller handoff. The [handoff guide](/learn/engineering-handoff-evidence/) lists the other forms.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Record the base commit when you send a patch](/learn/git-format-patch-base-commit/)
    
    Deployment failures The Proofline team November 24, 2026 3 min read
    
-   ### [Hand over uncommitted work without losing files](/learn/hand-over-uncommitted-changes/)
    
    Deployment failures The Proofline team November 24, 2026 3 min read
