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

5 messages from 2009-01-29 to 2009-01-29. Participants: Tay Ray Chuan, Miklos Vajna.
Thread: https://gitlist.dev/t/17435

## Tay Ray Chuan, 2009-01-29 14:06

Subject: git clone --bare doesn't create refs/heads/*?
Message-ID: <be6fef0d0901290606q25ad7c82ob250a5f89d4db0cf@mail.gmail.com>
URL: https://gitlist.dev/e/be6fef0d0901290606q25ad7c82ob250a5f89d4db0cf%40mail.gmail.com

```
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, 2009-01-29 14:26

Subject: Re: git clone --bare doesn't create refs/heads/*?
Message-ID: <20090129142657.GG21473@genesis.frugalware.org>
URL: https://gitlist.dev/e/20090129142657.GG21473%40genesis.frugalware.org
In-Reply-To: <be6fef0d0901290606q25ad7c82ob250a5f89d4db0cf@mail.gmail.com>

```
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, 2009-01-29 14:36

Subject: Re: git clone --bare doesn't create refs/heads/*?
Message-ID: <be6fef0d0901290636m5b472499mdf614841a06ec978@mail.gmail.com>
URL: https://gitlist.dev/e/be6fef0d0901290636m5b472499mdf614841a06ec978%40mail.gmail.com
In-Reply-To: <20090129142657.GG21473@genesis.frugalware.org>

```
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:
> 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, 2009-01-29 14:40

Subject: Re: git clone --bare doesn't create refs/heads/*?
Message-ID: <20090129144036.GH21473@genesis.frugalware.org>
URL: https://gitlist.dev/e/20090129144036.GH21473%40genesis.frugalware.org
In-Reply-To: <be6fef0d0901290636m5b472499mdf614841a06ec978@mail.gmail.com>

```
[ Please don't top-post. ]

On Thu, Jan 29, 2009 at 10:36:26PM +0800, Tay Ray Chuan <rctay89@gmail.com> wrote:
> 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, 2009-01-29 14:48

Subject: Re: git clone --bare doesn't create refs/heads/*?
Message-ID: <be6fef0d0901290648g3e057255p2e69491edc3227e2@mail.gmail.com>
URL: https://gitlist.dev/e/be6fef0d0901290648g3e057255p2e69491edc3227e2%40mail.gmail.com
In-Reply-To: <20090129144036.GH21473@genesis.frugalware.org>

```
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

```
