# git push <branch-name>

6 messages from 2010-10-05 to 2010-10-08. Participants: Eric Raible, Sverre Rabbelier, Michael J Gruber.
Thread: https://gitlist.dev/t/25360

## Eric Raible, 2010-10-05 20:29

Subject: git push <branch-name>
Message-ID: <AANLkTineD3DYsBJBBt13-EWX0_1YUf1cf1wTGUL-jRkg@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTineD3DYsBJBBt13-EWX0_1YUf1cf1wTGUL-jRkg%40mail.gmail.com

```
A newbie colleague asked why: "git push <branch>" didn't work.

Although I know that "git push <repo> <branch>" is the correct
syntax, I think that he has a point.  If branch.<branch>.remote
is defined it seems unambiguous to me.

So I can't see any reason NOT to dwimify

    git push <branch>

into

    git push $(git config branch.<branch>.remote) <branch>

What am I missing?

```

## Sverre Rabbelier, 2010-10-05 22:35

Subject: Re: git push <branch-name>
Message-ID: <AANLkTinjEoDWhq_EWPj+z++g-b7XMA9d2orXRGtuHyRB@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinjEoDWhq_EWPj%2Bz%2B%2Bg-b7XMA9d2orXRGtuHyRB%40mail.gmail.com
In-Reply-To: <AANLkTineD3DYsBJBBt13-EWX0_1YUf1cf1wTGUL-jRkg@mail.gmail.com>

```
Heya,

On Tue, Oct 5, 2010 at 22:29, Eric Raible <raible@gmail.com> wrote:
>    git push $(git config branch.<branch>.remote) <branch>

Since it is such a simple command expansion, why not create an alias
that does just that?

-- 
Cheers,

Sverre Rabbelier

```

## Eric Raible, 2010-10-06 00:52

Subject: Re: git push <branch-name>
Message-ID: <AANLkTi=k9aEqpvoEvU5f-t-63==fouFmJ+OxO=6sQd89@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3Dk9aEqpvoEvU5f-t-63%3D%3DfouFmJ%2BOxO%3D6sQd89%40mail.gmail.com
In-Reply-To: <AANLkTinjEoDWhq_EWPj+z++g-b7XMA9d2orXRGtuHyRB@mail.gmail.com>

```
On Tue, Oct 5, 2010 at 3:35 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> Since it is such a simple command expansion, why not create an alias
> that does just that?

Because I don't want an alias, I want to extend git-push.

According to the man page, "git push"

"Works like git push <remote>, where <remote> is the current branch's remote
 (or origin, if no remote is configured for the current branch)."

What I'm advocating is that "git push <branch>" would be described with:

"Works like git push <remote> <branch>, where <remote> is the <branch>'s remote
 (or origin, if no remote is configured for <branch>)."

```

## Michael J Gruber, 2010-10-07 10:50

Subject: Re: git push <branch-name>
Message-ID: <4CADA5E3.5060405@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4CADA5E3.5060405%40drmicha.warpmail.net
In-Reply-To: <AANLkTi=k9aEqpvoEvU5f-t-63==fouFmJ+OxO=6sQd89@mail.gmail.com>

```
Eric Raible venit, vidit, dixit 06.10.2010 02:52:
> On Tue, Oct 5, 2010 at 3:35 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
>> Since it is such a simple command expansion, why not create an alias
>> that does just that?
> 
> Because I don't want an alias, I want to extend git-push.
> 
> According to the man page, "git push"
> 
> "Works like git push <remote>, where <remote> is the current branch's remote
>  (or origin, if no remote is configured for the current branch)."
> 
> What I'm advocating is that "git push <branch>" would be described with:
> 
> "Works like git push <remote> <branch>, where <remote> is the <branch>'s remote
>  (or origin, if no remote is configured for <branch>)."

Now, if I have a remote foo and a branch foo, what is

git push foo

supposed to do?

Michael

```

## Eric Raible, 2010-10-07 17:41

Subject: Re: git push <branch-name>
Message-ID: <AANLkTikwmF74453He4q49CmdxYSREUQanx6JSoW8xxSL@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikwmF74453He4q49CmdxYSREUQanx6JSoW8xxSL%40mail.gmail.com
In-Reply-To: <4CADA5E3.5060405@drmicha.warpmail.net>

```
On Thu, Oct 7, 2010 at 3:50 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
>
> Now, if I have a remote foo and a branch foo, what is
>
> git push foo
>
> supposed to do?

http://thread.gmane.org/gmane.comp.version-control.git/158235/focus=158254

```

## Michael J Gruber, 2010-10-08 06:17

Subject: Re: git push <branch-name>
Message-ID: <4CAEB787.6000701@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4CAEB787.6000701%40drmicha.warpmail.net
In-Reply-To: <AANLkTikwmF74453He4q49CmdxYSREUQanx6JSoW8xxSL@mail.gmail.com>

```
Eric Raible venit, vidit, dixit 07.10.2010 19:41:
> On Thu, Oct 7, 2010 at 3:50 AM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>>
>> Now, if I have a remote foo and a branch foo, what is
>>
>> git push foo
>>
>> supposed to do?
> 
> http://thread.gmane.org/gmane.comp.version-control.git/158235/focus=158254

Yep, I saw it later only - Daniel had broken the thread.

Michael

```
