threads / discuss / 17435

git clone --bare doesn't create refs/heads/*?

Subject: git clone --bare doesn't create refs/heads/*?

## tl;dr

5 messages between Jan 29, 2009 and Jan 29, 2009.

replies: 4people: 2as markdown or json

Tay Ray Chuan· Jan 29, 2009, 14:06 UTC · lore
Hi,
just like to clarify a doubt of mine.

afaik, a bare repository is just a copy of the .git folder of the cloned repository. why isn't any of its branches copied too?

-- 
Cheers,
Ray Chuan
Miklos Vajna· Jan 29, 2009, 14:26 UTC · re: Tay Ray Chuan · lore

Re: git clone --bare doesn't create refs/heads/*?

On Thu, Jan 29, 2009 at 10:06:39PM +0800, Tay Ray Chuan <rctay89@gmail.com> wrote:
> afaik, a bare repository is just a copy of the .git folder of the
> cloned repository. why isn't any of its branches copied too?
Maybe you're searching for git clone --mirror and not git clone --bare?
Tay Ray Chuan· Jan 29, 2009, 14:36 UTC · re: Miklos Vajna · lore

Re: git clone --bare doesn't create refs/heads/*?

Hmm, no, --mirror adds extra remote tracking information.
Quoting the git-clone man page:
"...the branch heads at the remote are copied directly..."
which is to say, git clone --bare isn't doing what it's supposed to do.
that said, i'm not too sure about this, hence this thread.
On Thu, Jan 29, 2009 at 10:26 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
Show 6 quoted lines
> On Thu, Jan 29, 2009 at 10:06:39PM +0800, Tay Ray Chuan <rctay89@gmail.com> wrote:
>> afaik, a bare repository is just a copy of the .git folder of the
>> cloned repository. why isn't any of its branches copied too?
>
> Maybe you're searching for git clone --mirror and not git clone --bare?
>
-- 
Cheers,
Ray Chuan
Miklos Vajna· Jan 29, 2009, 14:40 UTC · re: Tay Ray Chuan · lore

Re: git clone --bare doesn't create refs/heads/*?

[ Please don't top-post. ]
On Thu, Jan 29, 2009 at 10:36:26PM +0800, Tay Ray Chuan <rctay89@gmail.com> wrote:
Show 9 quoted lines
> Hmm, no, --mirror adds extra remote tracking information.
> 
> Quoting the git-clone man page:
> 
> "...the branch heads at the remote are copied directly..."
> 
> which is to say, git clone --bare isn't doing what it's supposed to do.
> 
> that said, i'm not too sure about this, hence this thread.
Ah, packed refs. :)

See man git-pack-refs, git clone uses it to pack refs after a clone. They are still in the 'packed-refs' file.

Tay Ray Chuan· Jan 29, 2009, 14:48 UTC · re: Miklos Vajna · lore

Re: git clone --bare doesn't create refs/heads/*?

On Thu, Jan 29, 2009 at 10:40 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
> [ Please don't top-post. ]
Oops.
> Ah, packed refs. :)
>
> See man git-pack-refs, git clone uses it to pack refs after a clone.
> They are still in the 'packed-refs' file.
Thanks, that does clears things up.
-- 
Cheers,
Ray Chuan

← back to recent threads