From: Junio C Hamano Date: Fri, 26 Sep 2025 15:29:21 GMT Subject: Re: [PATCH v3 4/4] doc: git-push: clarify "what to push" Message-ID: In-Reply-To: Junio C Hamano writes: >> But I'm not sure it's true in this case: we just said above that >> "The default is `push.default=simple`, which will push to a branch with >> the same name as the current branch." > > So I think this simplified statement is what causes confusion. It > says push.default=simple will push to such and such place, but that > is not true.... After sleeping on this, I do think that at the crux of confusing wording in the current draft is the lack of stress on "simple" being a narrower special case of more general "upstream" for various push.default modes. In either of these modes, unless told otherwise with the configuration file or the command line arguments, "git push" pushes to update the upstream of the current branch. There is, as you said, an additional safety measure in the "simple" mode, that rejects a configuration to have a branch whose name is different in the remote repository as the upstream branch. In other words, the push.default=simple mode does not tell Git to push to a branch with the same name. Rather, as a variant of the push.default=upstream mode, it tells Git to follow the same "push to the upstream branch" rule, which requires you to configure your upstream. But the mode gives additional limit on the name of the branch that can be set to upstream. We should make our text clear enough that anybody who read about the push.default=simple configuration easily understand the above. We would need to find a good division between what to put in the main text and what to leave out to the "see ... for more detauls" part to guide those who read about "git push" command to the same realization without bombarding them with descriptions of full range of possible values of push.default. Peeking our earlier exchange to help me formulate my thinking a bit... > +To decide which branches, tags, or other refs to push, Git uses > +(in order of precedence): > + > +1. The `` argument(s) (for example `main` in `git push origin main`) > + or the `--all`, `--mirror`, or `--tags` options > +2. The `remote.*.push` configuration for the repository being pushed to > +3. The `push.default` configuration. The default is `push.default=simple`, > + which will push to a branch with the same name as the current branch. > + See the CONFIGURATION section below for more on `push.default`. > + > +As a safety measure, `git push` may fail if you haven't set an upstream > +for the current branch, depending on what `push.default` is set to. > +See the UPSTREAM BRANCHES section below for more on how to set and > +use upstreams. ... here is my attempt. 3. The `push.default` configuration. The default is `simple`, which is a variant of `upstream`. In either mode, "git push" updates the configured upstream branch (see the UPSTREAM BRANCHES section for more on how to set and use upstreams). The 'simple' mode has an additional limitation that the name of your configured upstream must be the same as your branch. (iow, I rolled the "As a safety measure" paragraph into 3. itself).