# tags not present in bare clone

4 messages from 2012-04-23 to 2012-04-23. Participants: Patricia Bittencourt Egeland, Junio C Hamano.
Thread: https://gitlist.dev/t/30310

## Patricia Bittencourt Egeland, 2012-04-23 17:28

Subject: tags not present in bare clone
Message-ID: <0BE9553B-C799-43D5-BA9A-28FC83CA0773@linea.gov.br>
URL: https://gitlist.dev/e/0BE9553B-C799-43D5-BA9A-28FC83CA0773%40linea.gov.br

```
Hi,

       I'm trying to create a bare clone from a regular repo (all locally; in the same machine). However a tag created in the regular repo can't be found in the fresh bare clone.
       I expected that the tags would also be present just like anything from "refs". Am I wrong about that? 

Thanks,
Patricia

```

## Junio C Hamano, 2012-04-23 19:17

Subject: Re: tags not present in bare clone
Message-ID: <xmqqsjfui7gn.fsf@junio.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqsjfui7gn.fsf%40junio.mtv.corp.google.com
In-Reply-To: <0BE9553B-C799-43D5-BA9A-28FC83CA0773@linea.gov.br>

```
Patricia Bittencourt Egeland <pbegeland@linea.gov.br> writes:

>        I'm trying to create a bare clone from a regular repo (all
>        locally; in the same machine). However a tag created in the
>        regular repo can't be found in the fresh bare clone.  I
>        expected that the tags would also be present just like anything
>        from "refs". Am I wrong about that?

Reproduction recipe???

A simple and straightforward attempt to reproduce what you said you did
in your message does not exhibit any problem.

    $ mkdir -p /var/tmp/junk && cd /var/tmp/junk
    $ git init src && cd src
    Initialized empty Git repository in /var/tmp/junk/src/.git/
    $ echo frotz >xyzzy && git add xyzzy && git commit -m initial
    [master (root-commit) b9c684a] initial
     1 file changed, 1 insertion(+)
     create mode 100644 xyzzy
    $ echo nitfol >xyzzy && git commit -a -m second
    [master 6982d52] second
     1 file changed, 1 insertion(+), 1 deletion(-)
    $ git tag -a -m 'First revision' v1.0 HEAD^
    $ git tag -a -m 'Second revision' v2.0 HEAD
    $ git for-each-ref
    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/heads/master
    33a6b315ffb461cba32d84ecd1692525a0846f5a tag	refs/tags/v1.0
    0d3f9dce20e28c6898423eb4a2c2010908e46a6c tag	refs/tags/v2.0
    $ cd ../ ;# back at /var/tmp/junk
    $ git clone src dst
    Cloning into 'dst'...
    done.
    $ cd dst
    $ git for-each-ref
    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/heads/master
    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/remotes/origin/HEAD
    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/remotes/origin/master
    33a6b315ffb461cba32d84ecd1692525a0846f5a tag	refs/tags/v1.0
    0d3f9dce20e28c6898423eb4a2c2010908e46a6c tag	refs/tags/v2.0

```

## Junio C Hamano, 2012-04-23 19:19

Subject: Re: tags not present in bare clone
Message-ID: <xmqqobqii7c2.fsf@junio.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqobqii7c2.fsf%40junio.mtv.corp.google.com
In-Reply-To: <xmqqsjfui7gn.fsf@junio.mtv.corp.google.com>

```
Junio C Hamano <gitster@pobox.com> writes:

> Patricia Bittencourt Egeland <pbegeland@linea.gov.br> writes:
>
>>        I'm trying to create a bare clone from a regular repo (all
>>        locally; in the same machine). However a tag created in the
>>        regular repo can't be found in the fresh bare clone.  I
>>        expected that the tags would also be present just like anything
>>        from "refs". Am I wrong about that?
>
> Reproduction recipe???
>
> A simple and straightforward attempt to reproduce what you said you did
> in your message does not exhibit any problem.
> ...

Oops, I forgot --bare.

>     $ cd ../ ;# back at /var/tmp/junk
>     $ git clone src dst

This should be "git --bare clone src dst" (or "git clone --bare src
dst").

But everything else in my previous message still holds true.  I am
getting the identical output as the following.

>     Cloning into 'dst'...
>     done.
>     $ cd dst
>     $ git for-each-ref
>     6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/heads/master
>     6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/remotes/origin/HEAD
>     6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/remotes/origin/master
>     33a6b315ffb461cba32d84ecd1692525a0846f5a tag	refs/tags/v1.0
>     0d3f9dce20e28c6898423eb4a2c2010908e46a6c tag	refs/tags/v2.0

```

## Patricia Bittencourt Egeland, 2012-04-23 20:43

Subject: Re: tags not present in bare clone
Message-ID: <98431788-0ED7-4ADB-972A-193587433216@linea.gov.br>
URL: https://gitlist.dev/e/98431788-0ED7-4ADB-972A-193587433216%40linea.gov.br
In-Reply-To: <xmqqobqii7c2.fsf@junio.mtv.corp.google.com>

```
Thanks Junio. 
I confirm that I can see the tags. 
I was looking (ls) in .git/refs/tags, only. 

But, after more search, it looks like tags may be stored in .git/packed-refs to improve a repo access. I didn't know about that.
It is also good to know about "git for-each-refs" to list tags and the commit they point to. 

Thanks,
Patricia


On Apr 23, 2012, at 1:19 PM, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Patricia Bittencourt Egeland <pbegeland@linea.gov.br> writes:
>> 
>>>       I'm trying to create a bare clone from a regular repo (all
>>>       locally; in the same machine). However a tag created in the
>>>       regular repo can't be found in the fresh bare clone.  I
>>>       expected that the tags would also be present just like anything
>>>       from "refs". Am I wrong about that?
>> 
>> Reproduction recipe???
>> 
>> A simple and straightforward attempt to reproduce what you said you did
>> in your message does not exhibit any problem.
>> ...
> 
> Oops, I forgot --bare.
> 
>>    $ cd ../ ;# back at /var/tmp/junk
>>    $ git clone src dst
> 
> This should be "git --bare clone src dst" (or "git clone --bare src
> dst").
> 
> But everything else in my previous message still holds true.  I am
> getting the identical output as the following.
> 
>>    Cloning into 'dst'...
>>    done.
>>    $ cd dst
>>    $ git for-each-ref
>>    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/heads/master
>>    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/remotes/origin/HEAD
>>    6982d523f08b93dc6862ae80e80065b208d0ba85 commit	refs/remotes/origin/master
>>    33a6b315ffb461cba32d84ecd1692525a0846f5a tag	refs/tags/v1.0
>>    0d3f9dce20e28c6898423eb4a2c2010908e46a6c tag	refs/tags/v2.0
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

```
