# Is it possible to list unpushed tags without accessing remote?

6 messages from 2014-06-26 to 2014-06-27. Participants: Kirill Likhodedov, Shawn Pearce, Andreas Schwab, Junio C Hamano.
Thread: https://gitlist.dev/t/37002

## Kirill Likhodedov, 2014-06-26 12:42

Subject: Is it possible to list unpushed tags without accessing remote?
Message-ID: <BAA3119F-8351-4BFD-B42A-C96E4C7A1440@jetbrains.com>
URL: https://gitlist.dev/e/BAA3119F-8351-4BFD-B42A-C96E4C7A1440%40jetbrains.com

```
Hi,

is it possible to know which tags are not yet pushed to a remote via a completely local command?

(e.g. the list of unpushed _commits_ may be received by ‘git log <upstream>..’)

I know it is possible to execute 'git ls-remote’ or 'git push --dry-run’, but both ask the remote server.
I’m almost sure that the answer is “NO”, but want to receive a confirmation from Git gurus :)


Thanks a lot!
-- Kirill.
```

## Shawn Pearce, 2014-06-26 16:13

Subject: Re: Is it possible to list unpushed tags without accessing remote?
Message-ID: <CAJo=hJvdMURuaEZA3XEWE_Uuq8QRZ+mt8K2H8XrbTuZsVX9gKQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJo%3DhJvdMURuaEZA3XEWE_Uuq8QRZ%2Bmt8K2H8XrbTuZsVX9gKQ%40mail.gmail.com
In-Reply-To: <BAA3119F-8351-4BFD-B42A-C96E4C7A1440@jetbrains.com>

```
On Thu, Jun 26, 2014 at 5:42 AM, Kirill Likhodedov
<kirill.likhodedov@jetbrains.com> wrote:
> is it possible to know which tags are not yet pushed to a remote via a completely local command?
>
> (e.g. the list of unpushed _commits_ may be received by ‘git log <upstream>..’)
>
> I know it is possible to execute 'git ls-remote’ or 'git push --dry-run’, but both ask the remote server.
> I’m almost sure that the answer is “NO”, but want to receive a confirmation from Git gurus :)

No. The client doesn't track what tags the remote has.

You may be able to guess by looking at `git log --decorate upstream..`
and seeing which tags, if any show up.

```

## Andreas Schwab, 2014-06-26 16:54

Subject: Re: Is it possible to list unpushed tags without accessing remote?
Message-ID: <874mz76281.fsf@igel.home>
URL: https://gitlist.dev/e/874mz76281.fsf%40igel.home
In-Reply-To: <CAJo=hJvdMURuaEZA3XEWE_Uuq8QRZ+mt8K2H8XrbTuZsVX9gKQ@mail.gmail.com>

```
Shawn Pearce <spearce@spearce.org> writes:

> On Thu, Jun 26, 2014 at 5:42 AM, Kirill Likhodedov
> <kirill.likhodedov@jetbrains.com> wrote:
>> is it possible to know which tags are not yet pushed to a remote via a completely local command?
>>
>> (e.g. the list of unpushed _commits_ may be received by ‘git log <upstream>..’)
>>
>> I know it is possible to execute 'git ls-remote’ or 'git push --dry-run’, but both ask the remote server.
>> I’m almost sure that the answer is “NO”, but want to receive a confirmation from Git gurus :)
>
> No. The client doesn't track what tags the remote has.

Not by default, but it is easy to configure your clone to fetch tags to
a separate namespace.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## Junio C Hamano, 2014-06-26 19:04

Subject: Re: Is it possible to list unpushed tags without accessing remote?
Message-ID: <xmqqlhsj4hmq.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqlhsj4hmq.fsf%40gitster.dls.corp.google.com
In-Reply-To: <874mz76281.fsf@igel.home>

```
Andreas Schwab <schwab@linux-m68k.org> writes:

> Shawn Pearce <spearce@spearce.org> writes:
>
>> On Thu, Jun 26, 2014 at 5:42 AM, Kirill Likhodedov
>> <kirill.likhodedov@jetbrains.com> wrote:
>>> is it possible to know which tags are not yet pushed to a remote via a completely local command?
>>>
>>> (e.g. the list of unpushed _commits_ may be received by ‘git log <upstream>..’)
>>>
>>> I know it is possible to execute 'git ls-remote’ or 'git push --dry-run’, but both ask the remote server.
>>> I’m almost sure that the answer is “NO”, but want to receive a confirmation from Git gurus :)
>>
>> No. The client doesn't track what tags the remote has.
>
> Not by default, but it is easy to configure your clone to fetch tags to
> a separate namespace.

But then in order to learn what tags the remote has, you need to
talk to the remote and it won't be "complately a local" operation
anymore, no?

```

## Kirill Likhodedov, 2014-06-26 19:20

Subject: Re: Is it possible to list unpushed tags without accessing remote?
Message-ID: <5968CD7E-9E90-422C-B4F7-C0151FDEB1B4@jetbrains.com>
URL: https://gitlist.dev/e/5968CD7E-9E90-422C-B4F7-C0151FDEB1B4%40jetbrains.com
In-Reply-To: <xmqqlhsj4hmq.fsf@gitster.dls.corp.google.com>

```

On 26 Jun 2014, at 23:04 , Junio C Hamano <gitster@pobox.com> wrote:

> Andreas Schwab <schwab@linux-m68k.org> writes:
> 
>> Not by default, but it is easy to configure your clone to fetch tags to
>> a separate namespace.
> 
> But then in order to learn what tags the remote has, you need to
> talk to the remote and it won't be "complately a local" operation
> anymore, no?

If I understand the solution correctly, it looks like it is not needed, if I’m OK with knowing which tags the remote had during the last fetch. 

Just like with commits: 'git log origin/master..’ can give me incorrect results if e.g. commits were rebased on the remote site. But we usually ignore such possibility as improbable.

```

## Andreas Schwab, 2014-06-27 07:41

Subject: Re: Is it possible to list unpushed tags without accessing remote?
Message-ID: <87pphu23zt.fsf@igel.home>
URL: https://gitlist.dev/e/87pphu23zt.fsf%40igel.home
In-Reply-To: <xmqqlhsj4hmq.fsf@gitster.dls.corp.google.com>

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

> But then in order to learn what tags the remote has, you need to
> talk to the remote and it won't be "complately a local" operation
> anymore, no?

Just like for every other remote ref.  If you need to know the
ultimative truth the only way is to ask the remote.  Your local copy is
just a cache that may be outdated any time.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```
