threads / discuss / 12068

Can a git repository be initialized with a bundle?

Subject: Can a git repository be initialized with a bundle?

## tl;dr

2 messages between Feb 13, 2008 and Feb 13, 2008.

replies: 1people: 2as markdown or json

Tom Koelman· Feb 13, 2008, 08:21 UTC · lore
Hi,
I got some repository from which I created a bundle like so:
$ git bundle create all.bundle --all
Now I want to recreate this repository somewhere else:

$ mkdir tmp ; cd tmp ; git init Initialized empty Git repository in .git/ $ git fetch all.bundle fatal: Couldn't find remote ref HEAD

It doesn't matter whether I try to fetch, pull, or add -f to the command line, I always get this response.

Am I trying to accomplish something that can't be done or am I doing it wrong?

I am running git version 1.5.4.1 under Linux.

Regards, Tom Koelman

Santi Béjar· Feb 13, 2008, 09:02 UTC · re: Tom Koelman · lore

Re: Can a git repository be initialized with a bundle?

On Feb 13, 2008 9:21 AM, Tom Koelman <tkoelman@xs4all.nl> wrote:
Show 6 quoted lines
>
> Hi,
>
> I got some repository from which I created a bundle like so:
>
> $ git bundle create all.bundle --all
--all does not imply HEAD, so:
$ git bundle create all.bundle --all HEAD
Show 6 quoted lines
> Now I want to recreate this repository somewhere else:
>
> $ mkdir tmp ; cd tmp ; git init
> Initialized empty Git repository in .git/
> $ git fetch all.bundle
> fatal: Couldn't find remote ref HEAD
you have to say explicitly the branches you want as:
$ git fetch all.bundle master:bundle/master
or with a remote:

$ git remote add bundle all.bundle $ git fetch bundle

>
> It doesn't matter whether I try to fetch, pull, or add -f to the command
> line, I always get this response.
The same happens with a normal remote repository without a HEAD.
>
> Am I trying to accomplish something that can't be done or am I doing it
> wrong?

I sent a path to support bundles in clone, but it was late for 1.5.4 and at some point "git clone" will be converted to C (now it is a script). For now you have to do the "git init ; git remote add -f ...", or similar.

Santi

← back to recent threads