git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git Tags
@ 2018-11-29 11:11 Stefanie Leisestreichler
  2018-11-29 11:56 ` Mateusz Loskot
  2018-11-29 15:09 ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 5+ messages in thread
From: Stefanie Leisestreichler @ 2018-11-29 11:11 UTC (permalink / raw)
  To: git

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

Why is the tag not available in origin?

Thanks,
Stefanie


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git Tags
  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 15:09 ` Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 5+ messages in thread
From: Mateusz Loskot @ 2018-11-29 11:56 UTC (permalink / raw)
  To: git

On Thu, 29 Nov 2018 at 12:50, Stefanie Leisestreichler
<stefanie.leisestreichler@peter-speer.de> wrote:
>
> 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?

From https://git-scm.com/book/en/v2/Git-Basics-Tagging
"By default, the git push command doesn’t transfer tags to remote servers.
You will have to explicitly push tags to a shared server after you
have created them."

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Git Tags
  2018-11-29 11:56 ` Mateusz Loskot
@ 2018-11-29 13:40   ` Randall S. Becker
  2018-11-29 13:45     ` Mateusz Loskot
  0 siblings, 1 reply; 5+ messages in thread
From: Randall S. Becker @ 2018-11-29 13:40 UTC (permalink / raw)
  To: 'Mateusz Loskot', git

On November 29, 2018 6:56, Mateusz Loskot wrote:
> On Thu, 29 Nov 2018 at 12:50, Stefanie Leisestreichler
> <stefanie.leisestreichler@peter-speer.de> wrote:
> >
> > 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?
> 
> >From https://git-scm.com/book/en/v2/Git-Basics-Tagging
> "By default, the git push command doesn’t transfer tags to remote servers.
> You will have to explicitly push tags to a shared server after you have created
> them."

git push --tags

and

git fetch --tags

to be symmetrical

Cheers,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git Tags
  2018-11-29 13:40   ` Randall S. Becker
@ 2018-11-29 13:45     ` Mateusz Loskot
  0 siblings, 0 replies; 5+ messages in thread
From: Mateusz Loskot @ 2018-11-29 13:45 UTC (permalink / raw)
  To: git

On Thu, 29 Nov 2018 at 14:40, Randall S. Becker <rsbecker@nexbridge.com> wrote:
> On November 29, 2018 6:56, Mateusz Loskot wrote:
> > On Thu, 29 Nov 2018 at 12:50, Stefanie Leisestreichler <stefanie.leisestreichler@peter-speer.de> wrote:
> > >
> > > 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?
> >
> > >From https://git-scm.com/book/en/v2/Git-Basics-Tagging
> > "By default, the git push command doesn’t transfer tags to remote servers.
> > You will have to explicitly push tags to a shared server after you have created
> > them."
>
> git push --tags
>

After my yesterday experience [1], I'd be careful with git push --tags :)

[1] genuine screenshot and link to related thread at
https://twitter.com/mloskot/status/1068072285846859776

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Git Tags
  2018-11-29 11:11 Git Tags Stefanie Leisestreichler
  2018-11-29 11:56 ` Mateusz Loskot
@ 2018-11-29 15:09 ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-11-29 15:09 UTC (permalink / raw)
  To: Stefanie Leisestreichler; +Cc: git


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).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-29 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).