Re: git push doesn't use local branch name as default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 27, 2021 at 11:39 PM Mathias Kunter <mathiaskunter@xxxxxxxxx> wrote:
>
> Felipe,
>
> thanks for your reply.
>
> > Sounds like you want to change the default to `push.default=current`.
>
> Yes, but shouldn't `simple` pushing also work? The documentation says
> about `push.default=simple`:
>
> > When pushing to a remote that is different from the remote you normally
> > pull from, work as `current`.

Perhaps this wording should be clarified to read

When you have a remote that you normally pull from but you are pushing
to a different remote then that one, then work as 'current'.

> If there is no upstream, then there also is no "remote I normally pull
> from", and thus, according to the doc, `simple` should actually work
> like `current` in this case. Am I wrong here?

The relevant code is

    return (fetch_remote && fetch_remote != remote);

so you only get the "current" behavior when fetch_remote is non-NULL.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux