Subject: Re: push.default=upstream doesn't play nicely with remote.pushdefault/branch.*.pushremote

From: Junio C Hamano <[email-masked]>
Date: Tue, 10 Sep 2013 09:06:29 -0700

Ximin Luo <[email-masked]> writes:

> (Please CC me as I am not subscribed.)
>
> $ git config -l | grep '^branch.master\|^push.'
> push.default=upstream
> branch.master.remote=upstream
> branch.master.merge=refs/heads/master
> branch.master.pushremote=origin
>
> $ git branch
> * master
>
> $ git push
> fatal: You are pushing to remote 'origin', which is not the upstream of
> your current branch 'master', without telling me what to push
> to update which remote branch.
>
> push.default=upstream means "push back where it came from (*)". However, if I specifically define remote.pushdefault or branch.*.pushremote, this clearly means I don't want to do (*) in this case.

I think this was discussed on the list during the last development
cycle.  Please check the list archive.

"git config --help" has this to say about it:

    * `upstream` - push the current branch back to the branch whose
      changes are usually integrated into the current branch (which is
      called `@{upstream}`).  This mode only makes sense if you are
      pushing to the same repository you would normally pull from
      (i.e. central workflow).

    * `simple` - in centralized workflow, work like `upstream` with an
      added safety to refuse to push if the upstream branch's name is
      different from the local one.

      When pushing to a remote that is different from the remote you normally
      pull from, work as `current`.