# git push interface inconsistency

3 messages from 2009-10-26 to 2009-10-26. Participants: Eugene Sajine, Avery Pennarun.
Thread: https://gitlist.dev/t/21366

## Eugene Sajine, 2009-10-26 22:25

Subject: git push interface inconsistency
Message-ID: <76c5b8580910261525y5397b54eyf9c3d58c0fe19fce@mail.gmail.com>
URL: https://gitlist.dev/e/76c5b8580910261525y5397b54eyf9c3d58c0fe19fce%40mail.gmail.com

```
Hi,

I have a question:

Why I can't do

$ git push my_tag

It will fail because the remote is not specified, even if there is
only one origin remote

but can do

$ git push --tags

and it will push tags to origin...

Thanks,
Eugene

```

## Avery Pennarun, 2009-10-26 22:31

Subject: Re: git push interface inconsistency
Message-ID: <32541b130910261531o36b8ce7eh6bddf26a2ae15663@mail.gmail.com>
URL: https://gitlist.dev/e/32541b130910261531o36b8ce7eh6bddf26a2ae15663%40mail.gmail.com
In-Reply-To: <76c5b8580910261525y5397b54eyf9c3d58c0fe19fce@mail.gmail.com>

```
On Mon, Oct 26, 2009 at 6:25 PM, Eugene Sajine <euguess@gmail.com> wrote:
> I have a question:
>
> Why I can't do
>
> $ git push my_tag
>
> It will fail because the remote is not specified, even if there is
> only one origin remote
>
> but can do
>
> $ git push --tags
>
> and it will push tags to origin...

Because 'my_tag' is interpreted as the name or URL of the remote, not
as a branch name.  You can do "git push origin" and it will guess the
branch name(s) to push, but because of that, the one-parameter push
can't *also* be used to guess the remote name.

In contrast, --tags is a flag, so it's actually the zero-parameter
version of push, which assumes 'origin' and then guesses the branch
name (and --tags changes the guessed result).

Hope that helps.

Have fun,

Avery

```

## Eugene Sajine, 2009-10-26 23:39

Subject: Re: git push interface inconsistency
Message-ID: <76c5b8580910261639p374c6391h3ae39bf4512c2f10@mail.gmail.com>
URL: https://gitlist.dev/e/76c5b8580910261639p374c6391h3ae39bf4512c2f10%40mail.gmail.com
In-Reply-To: <32541b130910261531o36b8ce7eh6bddf26a2ae15663@mail.gmail.com>

```
Got it.


Thanks!

On Mon, Oct 26, 2009 at 6:31 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> On Mon, Oct 26, 2009 at 6:25 PM, Eugene Sajine <euguess@gmail.com> wrote:
>> I have a question:
>>
>> Why I can't do
>>
>> $ git push my_tag
>>
>> It will fail because the remote is not specified, even if there is
>> only one origin remote
>>
>> but can do
>>
>> $ git push --tags
>>
>> and it will push tags to origin...
>
> Because 'my_tag' is interpreted as the name or URL of the remote, not
> as a branch name.  You can do "git push origin" and it will guess the
> branch name(s) to push, but because of that, the one-parameter push
> can't *also* be used to guess the remote name.
>
> In contrast, --tags is a flag, so it's actually the zero-parameter
> version of push, which assumes 'origin' and then guesses the branch
> name (and --tags changes the guessed result).
>
> Hope that helps.
>
> Have fun,
>
> Avery
>

```
