git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: tags not present in bare clone

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 23, 2012, 19:17 UTC
Message-ID
<xmqqsjfui7gn.fsf@junio.mtv.corp.google.com>
In-Reply-To
<0BE9553B-C799-43D5-BA9A-28FC83CA0773@linea.gov.br>
Patricia Bittencourt Egeland <pbegeland@linea.gov.br> writes:
Show 5 quoted lines
>        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
Previous: Patricia Bittencourt EgelandNext: Junio C Hamano
Message 2 of 4 in “tags not present in bare clone”
  1. Patricia Bittencourt EgelandApr 23, 2012
  2. Junio C HamanoApr 23, 2012
  3. Junio C HamanoApr 23, 2012
  4. Patricia Bittencourt EgelandApr 23, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.