# How can I tell if a tag has been pushed, or not?

4 messages from 2009-07-10 to 2009-07-11. Participants: layer, Alex Riesen, Andreas Ericsson.
Thread: https://gitlist.dev/t/20080

## layer, 2009-07-10 17:43

Subject: How can I tell if a tag has been pushed, or not?
Message-ID: <14563.1247247807@relay.known.net>
URL: https://gitlist.dev/e/14563.1247247807%40relay.known.net

```
Here's the problem:

I expect that users, in their own private repos, will from time to
time create tags that should not be pushed.  Sometimes, tags that
should be pushed will be created.

I could require that the "public" tags follow a specific convention
(start with "release", or something).  Then, the scripts all my
developers use could use that and push only certain tags.  However,
over time there could be a large number of them.  It seems undesirable
to push each tag each time a push is done.  So, how can I tell if a
tag has already been pushed?  Is there a way?

Thanks.

```

## Alex Riesen, 2009-07-10 19:28

Subject: Re: How can I tell if a tag has been pushed, or not?
Message-ID: <81b0412b0907101228t2cc55aa6g21d2a11ec9caa1c1@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0907101228t2cc55aa6g21d2a11ec9caa1c1%40mail.gmail.com
In-Reply-To: <14563.1247247807@relay.known.net>

```
On Fri, Jul 10, 2009 at 19:43, layer<layer@known.net> wrote:
> Here's the problem:
>
> I expect that users, in their own private repos, will from time to
> time create tags that should not be pushed.  Sometimes, tags that
> should be pushed will be created.
>
> I could require that the "public" tags follow a specific convention
> (start with "release", or something).  Then, the scripts all my
> developers use could use that and push only certain tags.  However,
> over time there could be a large number of them.  It seems undesirable
> to push each tag each time a push is done.  So, how can I tell if a
> tag has already been pushed?  Is there a way?

git push does not push any tags by default. You either have to
specify them explicitly or add --tags (all tags). Maybe that is enough?

Otherwise, there is always git ls-remote 'tags/*'...

```

## layer, 2009-07-10 20:02

Subject: Re: How can I tell if a tag has been pushed, or not?
Message-ID: <16198.1247256143@relay.known.net>
URL: https://gitlist.dev/e/16198.1247256143%40relay.known.net
In-Reply-To: <81b0412b0907101228t2cc55aa6g21d2a11ec9caa1c1@mail.gmail.com>

```
Alex Riesen <raa.lkml@gmail.com> wrote:

>> On Fri, Jul 10, 2009 at 19:43, layer<layer@known.net> wrote:
>> > Here's the problem:
>> >
>> > I expect that users, in their own private repos, will from time to
>> > time create tags that should not be pushed.  Sometimes, tags that
>> > should be pushed will be created.
>> >
>> > I could require that the "public" tags follow a specific convention
>> > (start with "release", or something).  Then, the scripts all my
>> > developers use could use that and push only certain tags.  However,
>> > over time there could be a large number of them.  It seems undesirable
>> > to push each tag each time a push is done.  So, how can I tell if a
>> > tag has already been pushed?  Is there a way?
>> 
>> git push does not push any tags by default. You either have to
>> specify them explicitly or add --tags (all tags). Maybe that is enough?

No, I already knew about that.

>> Otherwise, there is always git ls-remote 'tags/*'...

This is what I needed.  Thanks.

```

## Andreas Ericsson, 2009-07-11 13:44

Subject: Re: How can I tell if a tag has been pushed, or not?
Message-ID: <4A589755.2020600@op5.com>
URL: https://gitlist.dev/e/4A589755.2020600%40op5.com
In-Reply-To: <14563.1247247807@relay.known.net>

```
layer wrote:
> Here's the problem:
> 
> I expect that users, in their own private repos, will from time to
> time create tags that should not be pushed.  Sometimes, tags that
> should be pushed will be created.
> 
> I could require that the "public" tags follow a specific convention
> (start with "release", or something).  Then, the scripts all my
> developers use could use that and push only certain tags.  However,
> over time there could be a large number of them.  It seems undesirable
> to push each tag each time a push is done.  So, how can I tell if a
> tag has already been pushed?  Is there a way?
> 

At $dayjob we only allow annotated tags to be pushed. The default
update hook works like a charm for that. All private tags are kept
un-annotated and can therefore never be pushed by accident.

/Andreas

```
