git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "D. Ben Knoble" <ben.knoble@gmail.com>,
	"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>,
	"Jean-Noël AVILA" <jn.avila@free.fr>,
	"Julia Evans" <julia@jvns.ca>
Subject: [PATCH v5 0/5] doc: git-push: clarify DESCRIPTION section
Date: Mon, 06 Oct 2025 18:58:46 +0000	[thread overview]
Message-ID: <pull.1964.v5.git.1759777131.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1964.v4.git.1759262314.gitgitgadget@gmail.com>

I surveyed 16 Git users about the git push man page. Here's a rewrite of the
DESCRIPTION section and the definition of <refspec> based on the feedback.
The goal is to clarify it while communicating the same information. The most
common piece of feedback was that folks didn't understand what the term
"ref" means. Most of the users who said they did not understand the term
"ref" have been using Git for 10+ years.

changes in v2:

 * The biggest change is to add a new UPSTREAM BRANCHES section to explain
   what an upstream is
 * Drop the "refspec" changes from this patch series, I've made revisions to
   them based on the comments here but I felt like this was getting too big.
 * Added some backticks `` that I'd missed, from Ben's review
 * From Junio's review, "The current branch must have a configured upstream
   with the same name, so this will fail when pushing a new branch" was not
   true, so replace it with a less detailed but hopefully true statement.
   After a very long conversation with Ben I realized that actually
   push.default=simple's behaviour is not really that simple (perhaps I
   should think of it as more "safe" than "simple", since "current" seems
   simpler), so it's more realistic to refer any questions to the
   CONFIGURATION section which describes the behaviour in more detail.
 * Rewrite all the commits to explain the problem they're trying to solve &
   thinking behind them in more detail. Let me know if I added too much /
   not enough detail.

changes in v3:

 * mention that git push also needs to send data in addition to updating the
   branch, from Junio's review
 * fix a newline, from Junio's review
 * un-rename urls-remotes.adoc, from Junio's review
 * mention pushRemote and git checkout in the UPSTREAM BRANCHES section and
   be clearer about what's meant by "the relationship between the current
   branch and the upstream", from Junio's review
 * fix AsciiDoc formatting issue, from Junio's review

changes in v4:

 * Add "the simplest way to push is git push <remote> <branch>" at the
   beginning since (as discussed) this is the form of git push that's
   easiest to explain.
 * Remove "as a safety measure" since (as discussed with Junio) the reason
   that git push sometimes requires you to set an upstream is very
   confusing, and "as a safety measure..." makes it sound more principled
   than it is. Also update the commit message to say that the previous
   explanation was not describing push.default=simple's behaviour
   accurately.
 * Reword "To decide which repository to push to..." because I felt like it
   was still phrased in a clunky way.
 * Make UPSTREAM BRANCHES and CONFIGURATION into actual links in the HTML
   docs
 * Fix formatting in UPSTREAM BRANCHES section, from Junio's review
 * Fix some commit message mistakes, from Junio's review

changes in v5:

 * remove a bad example of git branch --track, from Junio's review
 * fix some formatting issues, from Jean-Noël's review

Julia Evans (5):
  doc: git-push: clarify intro
  doc: add an UPSTREAM BRANCHES section to pull/push/fetch
  doc: git-push: clarify "where to push"
  doc: git-push: clarify "what to push"
  doc: git-push: Add explanation of `git push origin main`

 Documentation/git-push.adoc     | 46 +++++++++++++++++++--------------
 Documentation/urls-remotes.adoc | 42 ++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 20 deletions(-)


base-commit: c44beea485f0f2feaf460e2ac87fdd5608d63cf0
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1964%2Fjvns%2Fclarify-push-v5
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1964/jvns/clarify-push-v5
Pull-Request: https://github.com/gitgitgadget/git/pull/1964

Range-diff vs v4:

 1:  d3160fb0af = 1:  4811ce1c86 doc: git-push: clarify intro
 2:  69825d4634 ! 2:  10a9718421 doc: add an UPSTREAM BRANCHES section to pull/push/fetch
     @@ Documentation/urls-remotes.adoc: git push uses:
       ------------
       
       
     --
     --
     -+UPSTREAM BRANCHES[[UPSTREAM-BRANCHES]]
     -+--------------------------------------
     ++[[UPSTREAM-BRANCHES]]
     ++UPSTREAM BRANCHES
     ++-----------------
      +
      +Branches in Git can optionally have an upstream remote branch.
      +Git defaults to using the upstream branch for remote operations, for example:
     @@ Documentation/urls-remotes.adoc: git push uses:
      +
      +The upstream is stored in `.git/config`, in the "remote" and "merge"
      +fields. For example, if `main`'s upstream is `origin/main`:
     -+
     -+	[branch "main"]
     -+	   remote = origin
     -+	   merge = refs/heads/main
     -+
     + 
     ++------------
     ++[branch "main"]
     ++   remote = origin
     ++   merge = refs/heads/main
     ++------------
     + 
      +You can set an upstream branch explicitly with
     -+`git push --set-upstream <remote> <branch>` or `git branch --track`,
     ++`git push --set-upstream <remote> <branch>`
      +but Git will often automatically set the upstream for you, for example:
      +
      +* When you clone a repository, Git will automatically set the upstream
 3:  244c35ef2b = 3:  336023fbf1 doc: git-push: clarify "where to push"
 4:  c1d4ea8d27 ! 4:  8e82c508f6 doc: git-push: clarify "what to push"
     @@ Documentation/git-push.adoc: a `git gc` command on the origin repository.
       
       include::transfer-data-leaks.adoc[]
       
     --CONFIGURATION
     -+CONFIGURATION[[CONFIGURATION]]
     ++[[CONFIGURATION]]
     + CONFIGURATION
       -------------
       
     - include::includes/cmd-config-section-all.adoc[]
 5:  9435f0ce8d = 5:  ddeb8ecabe doc: git-push: Add explanation of `git push origin main`

-- 
gitgitgadget

  parent reply	other threads:[~2025-10-06 18:58 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26 20:40 [PATCH 0/4] doc: git-push: clarify DESCRIPTION section & refspec definition Julia Evans via GitGitGadget
2025-08-26 20:40 ` [PATCH 1/4] doc: git-push: update intro Julia Evans via GitGitGadget
2025-08-28 13:53   ` D. Ben Knoble
2025-08-28 16:18     ` Junio C Hamano
2025-08-29  7:20       ` Kristoffer Haugsbakk
2025-08-28 17:47     ` Julia Evans
2025-08-28 19:39       ` D. Ben Knoble
2025-08-26 20:40 ` [PATCH 2/4] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-08-27  0:05   ` Junio C Hamano
2025-08-26 20:40 ` [PATCH 3/4] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-08-26 23:57   ` Junio C Hamano
2025-08-27 13:52     ` Julia Evans
2025-08-28 14:25   ` D. Ben Knoble
2025-08-26 20:40 ` [PATCH 4/4] doc: git-push: rewrite refspec specification Julia Evans via GitGitGadget
2025-08-26 23:34   ` Junio C Hamano
2025-08-27 13:10     ` Julia Evans
2025-08-28 19:28   ` D. Ben Knoble
2025-09-12 18:55 ` [PATCH v2 0/4] doc: git-push: clarify DESCRIPTION section & refspec definition Julia Evans via GitGitGadget
2025-09-12 18:55   ` [PATCH v2 1/4] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-09-12 20:54     ` Junio C Hamano
2025-09-15 20:00       ` Julia Evans
2025-09-16  1:44         ` Junio C Hamano
2025-09-16 18:46           ` Julia Evans
2025-09-16 20:38             ` Ben Knoble
2025-09-16 21:59               ` Junio C Hamano
2025-09-17 18:42           ` Junio C Hamano
2025-09-18 14:20             ` Julia Evans
2025-09-12 18:55   ` [PATCH v2 2/4] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-09-12 21:17     ` Junio C Hamano
2025-09-15 20:19       ` Julia Evans
2025-09-15 21:48         ` Junio C Hamano
2025-09-15 23:09           ` Julia Evans
2025-09-16  5:25     ` Junio C Hamano
2025-09-16  5:33       ` Junio C Hamano
2025-09-16  5:39         ` Junio C Hamano
2025-09-18 21:02           ` Julia Evans
2025-09-12 18:55   ` [PATCH v2 3/4] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-09-12 21:18     ` Junio C Hamano
2025-09-12 21:19     ` Junio C Hamano
2025-09-15 20:52       ` Julia Evans
2025-09-12 18:55   ` [PATCH v2 4/4] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-09-23 17:44   ` [PATCH v3 0/4] doc: git-push: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-09-23 17:44     ` [PATCH v3 1/4] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-09-23 17:44     ` [PATCH v3 2/4] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-09-24 19:51       ` Junio C Hamano
2025-09-30 19:20         ` Julia Evans
2025-09-23 17:44     ` [PATCH v3 3/4] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-09-23 17:44     ` [PATCH v3 4/4] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-09-24 20:01       ` Junio C Hamano
2025-09-25 20:50         ` Julia Evans
2025-09-25 21:15           ` Junio C Hamano
2025-09-25 22:34             ` Julia Evans
2025-09-26  1:27               ` Junio C Hamano
2025-09-26 15:29                 ` Junio C Hamano
2025-09-26 17:31                   ` Julia Evans
2025-09-26 19:03                     ` Junio C Hamano
2025-09-26 22:27                       ` Julia Evans
2025-09-26 23:07                         ` Junio C Hamano
2025-09-28 21:38                           ` D. Ben Knoble
2025-09-23 17:56     ` [PATCH v3 0/4] doc: git-push: clarify DESCRIPTION section D. Ben Knoble
2025-09-30 19:58     ` [PATCH v4 0/5] " Julia Evans via GitGitGadget
2025-09-30 19:58       ` [PATCH v4 1/5] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-09-30 19:58       ` [PATCH v4 2/5] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-09-30 23:39         ` Junio C Hamano
2025-10-03 18:23           ` Julia Evans
2025-10-03 19:12             ` Junio C Hamano
2025-10-01 17:30         ` Jean-Noël AVILA
2025-10-03 17:54           ` Julia Evans
2025-09-30 19:58       ` [PATCH v4 3/5] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-09-30 19:58       ` [PATCH v4 4/5] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-09-30 21:01         ` Junio C Hamano
2025-10-01 17:36         ` Jean-Noël AVILA
2025-09-30 19:58       ` [PATCH v4 5/5] doc: git-push: Add explanation of `git push origin main` Julia Evans via GitGitGadget
2025-10-01 22:29         ` D. Ben Knoble
2025-10-03 17:58           ` Julia Evans
2025-10-01 22:28       ` [PATCH v4 0/5] doc: git-push: clarify DESCRIPTION section D. Ben Knoble
2025-10-06 18:58       ` Julia Evans via GitGitGadget [this message]
2025-10-06 18:58         ` [PATCH v5 1/5] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 2/5] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-10-07 12:23           ` Kristoffer Haugsbakk
2025-10-07 13:35             ` Julia Evans
2025-10-07 18:35               ` D. Ben Knoble
2025-10-06 18:58         ` [PATCH v5 3/5] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 4/5] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 5/5] doc: git-push: Add explanation of `git push origin main` Julia Evans via GitGitGadget
2025-10-06 21:53         ` [PATCH v5 0/5] doc: git-push: clarify DESCRIPTION section D. Ben Knoble
2025-10-06 22:07         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1964.v5.git.1759777131.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    --cc=julia@jvns.ca \
    --cc=kristofferhaugsbakk@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).