All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Stefanie Leisestreichler <stefanie.leisestreichler@peter-speer.de>
Cc: git <git@vger.kernel.org>
Subject: Re: Git Tags
Date: Thu, 29 Nov 2018 16:09:57 +0100	[thread overview]
Message-ID: <87woovyl6i.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <c8fc0da2-c3ff-4985-e4a2-a066a3a6f2af@peter-speer.de>


On Thu, Nov 29 2018, Stefanie Leisestreichler wrote:

> Hi.
>
> I have done this (on box A):
>
> git commit -m "Message"
> git tag -a 0.9.0
> git push origin master
>
> In my local repository, when I run "git tag" it is showing me "0.9.0".
>
> Then I did (on box B)
> git clone ssh://user@host:/path/project.git
> cd project
> git tag
>
> Now git tag is showing nothing.
>
> Why is the tag only available in my local repository?
>
> Also when I try to
> git clone --branch 0.9.0 ssh://user@host:/path/project.git
> it tells me: fatal:remote branch not found in upstream repository origin

Because --branch <name> means get refs/heads/<name>, tags are not
branches. However, because we're apparently quite loose about this in
the clone/fetch code this does give you the tag if it exists, but
probably not in the way you expect.

We interpret the argument as a branch, and will get not only this tag
but "follow" (see --no-tags in git-fetch(1)) the tag as though it were a
branch and give you all tags leading up to that one. This would give you
a single tag:

    git clone --no-tags --branch v2.19.0 --single-branch https://github.com/git/git.git

But this is a more direct way to do it:

    git init git; git -C git fetch --no-tags https://github.com/git/git.git tag v2.19.0

Which'll since you said it failed that's because you haven't pushed the
tag. Try 'git ls-remote <url>' to see if it's there (it's not).

  parent reply	other threads:[~2018-11-29 15:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 11:11 Git Tags Stefanie Leisestreichler
2018-11-29 11:56 ` Mateusz Loskot
2018-11-29 13:40   ` Randall S. Becker
2018-11-29 13:45     ` Mateusz Loskot
2018-11-29 15:09 ` Ævar Arnfjörð Bjarmason [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-06-16  1:07 Git tags Oliver Beattie
2017-06-16  1:14 ` Daniel Kahn Gillmor
2017-06-16  2:44 ` Jason A. Donenfeld
2017-06-16 12:07   ` Martin Eskdale Moen
2017-06-16 12:08     ` Jason A. Donenfeld
2017-06-16 12:12       ` Martin Eskdale Moen
2017-06-16 12:23         ` Jason A. Donenfeld
2017-06-16 16:40   ` Oliver Beattie
2009-12-04 11:27 Martyn Welch
2009-12-09  0:19 ` Geoff Levand
2008-04-03 13:54 Yegor Yefremov
2008-04-03 14:32 ` Andre Haupt
2008-04-03 14:40   ` Yegor Yefremov
2008-04-03 14:47     ` Andre Haupt
2008-04-03 14:55       ` Andre Haupt
2007-10-22 11:24 GIT tags Iqbal
2007-10-22 11:35 ` Felipe Balbi
2007-10-22 13:02 ` Trilok Soni
2007-10-23  0:53   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87woovyl6i.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=stefanie.leisestreichler@peter-speer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.