All of lore.kernel.org
 help / color / mirror / Atom feed
* Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it
@ 2016-12-22 21:14 Stefan Monov
  2016-12-22 21:18 ` Stefan Monov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Monov @ 2016-12-22 21:14 UTC (permalink / raw)
  To: git

Hi.

I'd like to use just:

    git push

or at most:

    git push origin

rather than having to first check which is the active branch with `git
branch --list`, then type:

    git push origin <branch>

At [1] and [2] I've seen that if I do this once:

    git push -u origin <branch>

then from then on I can use just `git push` _for that branch_.
However, I don't want to do this "setup" step for each branch, because
it's extra work that I also may forget to do.

Why is this "setup" step necessary and can I avoid it?

Thanks,
Stefan

[1] http://stackoverflow.com/q/19312622
[2] http://stackoverflow.com/q/6529136

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it
  2016-12-22 21:14 Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it Stefan Monov
@ 2016-12-22 21:18 ` Stefan Monov
  2016-12-22 21:41 ` Junio C Hamano
  2016-12-22 21:46 ` Jacob Keller
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Monov @ 2016-12-22 21:18 UTC (permalink / raw)
  To: git

Also, if I do the "setup" step (`push -u`) for a branch that doesn't
exist yet (neither on my PC nor on the server), does that remove the
need to do `git checkout -b <branch>` first?

On Thu, Dec 22, 2016 at 11:14 PM, Stefan Monov <logixoul@gmail.com> wrote:
> Hi.
>
> I'd like to use just:
>
>     git push
>
> or at most:
>
>     git push origin
>
> rather than having to first check which is the active branch with `git
> branch --list`, then type:
>
>     git push origin <branch>
>
> At [1] and [2] I've seen that if I do this once:
>
>     git push -u origin <branch>
>
> then from then on I can use just `git push` _for that branch_.
> However, I don't want to do this "setup" step for each branch, because
> it's extra work that I also may forget to do.
>
> Why is this "setup" step necessary and can I avoid it?
>
> Thanks,
> Stefan
>
> [1] http://stackoverflow.com/q/19312622
> [2] http://stackoverflow.com/q/6529136

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it
  2016-12-22 21:14 Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it Stefan Monov
  2016-12-22 21:18 ` Stefan Monov
@ 2016-12-22 21:41 ` Junio C Hamano
  2016-12-22 21:46 ` Jacob Keller
  2 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2016-12-22 21:41 UTC (permalink / raw)
  To: Stefan Monov; +Cc: git

Stefan Monov <logixoul@gmail.com> writes:

> I'd like to use just:
>
>     git push
>
> or at most:
>
>     git push origin
>
> rather than having to first check which is the active branch with `git
> branch --list`, then type:
>
>     git push origin <branch>

Perhaps you are a target audience of

    $ git config push.default current

then?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it
  2016-12-22 21:14 Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it Stefan Monov
  2016-12-22 21:18 ` Stefan Monov
  2016-12-22 21:41 ` Junio C Hamano
@ 2016-12-22 21:46 ` Jacob Keller
  2016-12-27 17:47   ` Stefan Monov
  2 siblings, 1 reply; 5+ messages in thread
From: Jacob Keller @ 2016-12-22 21:46 UTC (permalink / raw)
  To: Stefan Monov; +Cc: Git mailing list

On Thu, Dec 22, 2016 at 1:14 PM, Stefan Monov <logixoul@gmail.com> wrote:
> Hi.
>
> I'd like to use just:
>
>     git push
>
> or at most:
>
>     git push origin
>
> rather than having to first check which is the active branch with `git
> branch --list`, then type:
>
>     git push origin <branch>
>
> At [1] and [2] I've seen that if I do this once:
>
>     git push -u origin <branch>
>
> then from then on I can use just `git push` _for that branch_.
> However, I don't want to do this "setup" step for each branch, because
> it's extra work that I also may forget to do.
>
> Why is this "setup" step necessary and can I avoid it?
>
> Thanks,
> Stefan
>
> [1] http://stackoverflow.com/q/19312622
> [2] http://stackoverflow.com/q/6529136


Try setting "push.default" configuration setting, see "git help
config" and search for push.default

I *think* what you want is "push.default = current" but you should
read up on each option.

Thanks,
Jake

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it
  2016-12-22 21:46 ` Jacob Keller
@ 2016-12-27 17:47   ` Stefan Monov
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monov @ 2016-12-27 17:47 UTC (permalink / raw)
  To: Jacob Keller; +Cc: Git mailing list

Thanks guys!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-27 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-22 21:14 Making it possible to do “git push origin” instead of “git push origin <branch>”, without having to one-time prepare each branch for it Stefan Monov
2016-12-22 21:18 ` Stefan Monov
2016-12-22 21:41 ` Junio C Hamano
2016-12-22 21:46 ` Jacob Keller
2016-12-27 17:47   ` Stefan Monov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.