threads / discuss / 25360

git push <branch-name>

Subject: git push <branch-name>

## tl;dr

6 messages between Oct 5, 2010 and Oct 8, 2010.

replies: 5people: 3as markdown or json

Eric Raible· Oct 5, 2010, 20:29 UTC · lore
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· Oct 5, 2010, 22:35 UTC · re: Eric Raible · lore

Re: git push <branch-name>

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· Oct 6, 2010, 00:52 UTC · re: Sverre Rabbelier · lore

Re: git push <branch-name>

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· Oct 7, 2010, 10:50 UTC · re: Eric Raible · lore

Re: git push <branch-name>

Eric Raible venit, vidit, dixit 06.10.2010 02:52:
Show 15 quoted lines
> 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· Oct 7, 2010, 17:41 UTC · re: Michael J Gruber · lore

Re: git push <branch-name>

On Thu, Oct 7, 2010 at 3:50 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 6 quoted lines
>
> 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· Oct 8, 2010, 06:17 UTC · re: Eric Raible · lore

Re: git push <branch-name>

Eric Raible venit, vidit, dixit 07.10.2010 19:41:
Show 10 quoted lines
> 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

← back to recent threads