How to unbundle a git bundle?
Asked Answered
A

1

10

I just received a Git bundle via email. How do I unbundle it in order to read it? I am having trouble using the unbundle command. I have tried

git unbundle *bundle name* 

but that gives me just a weird code

eae0b00697e53cd87c871143051673f3ee413148  

and refs/heads/master

Amatruda answered 16/3, 2017 at 16:43 Comment(1)
We need more information to help you. For example, what is the "weird code"?Temporize
M
17

I am having trouble using the unbundle command.

You are not supposed to run this command at all.

I just received a Git bundle via email. How do I unbundle it in order to read it?

This is described in the git bundle documentation:

EXAMPLE

Assume you want to transfer the history from a repository R1 on machine A to another repository R2 on machine B. For whatever reason, direct connection between A and B is not allowed, but we can move data from A to B via some mechanism (CD, email, etc.). We want to update R2 with development made on the branch master in R1.

To bootstrap the process, you can first create a bundle that does not have any basis. You can use a tag to remember up to what commit you last processed, in order to make it easy to later update the other repository with an incremental bundle:

machineA$ cd R1
machineA$ git bundle create file.bundle master
machineA$ git tag -f lastR2bundle master

Then you transfer file.bundle to the target machine B. Because this bundle does not require any existing object to be extracted, you can create a new repository on machine B by cloning from it:

machineB$ git clone -b master /home/me/tmp/file.bundle R2

This will define a remote called "origin" in the resulting repository that lets you fetch and pull from the bundle. The $GIT_DIR/config file in R2 will have an entry like this:

[remote "origin"]
    url = /home/me/tmp/file.bundle
    fetch = refs/heads/*:refs/remotes/origin/*

See the rest of the documentation for the rest of the instructions. Note that you are "machine B" in this example; someone else, on machine A, has done the first few steps. (Did they do them correctly? I don't know; do you?)

Mannino answered 16/3, 2017 at 19:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.