git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] Documentation: rework src/dst description in git push

From
AMAnders Melchiorsen <mail@cup.kalibalik.dk>
Date
Jan 25, 2009, 23:45 UTC
Message-ID
<1232927133-30377-4-git-send-email-mail@cup.kalibalik.dk>
In-Reply-To
<1232927133-30377-3-git-send-email-mail@cup.kalibalik.dk>

This tries to make the description of ref matching in git push easier to read. Beauty is in the eye of the beholder, though.

Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
---

This is a followup to http://article.gmane.org/gmane.comp.version-control.git/99553/

 Documentation/git-push.txt |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 6d478c5..1b3de4f 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -38,20 +38,21 @@ OPTIONS
 	by a colon `:`, followed by the destination ref <dst>.
 	Find various forms of refspecs in examples section.
 +
-The <src> side represents the source branch (or arbitrary
-"SHA1 expression", such as `master~4` (four parents before the
-tip of `master` branch); see linkgit:git-rev-parse[1]) that you
-want to push.  The <dst> side represents the destination location.
+The <src> is often the name of the branch you would want to push, but
+it can be any arbitrary "SHA-1 expression", such as `master~4` or
+`HEAD` (see linkgit:git-rev-parse[1]).
 +
-The local ref that matches <src> is used
-to fast forward the remote ref that matches <dst>.  If
-the optional leading plus `+` is used, the remote ref is updated
-even if it does not result in a fast forward update.
+The <dst> tells which ref on the remote side is updated with this
+push. Arbitrary expressions cannot be used here, an actual ref must
+be named. If `:`<dst> is omitted, the same ref as <src> will be
+updated.
 +
-`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
+The object referenced by <src> is used to fast forward the ref <dst>
+on the remote side. If the optional leading plus `{plus}` is used, the
+remote ref is updated even if it does not result in a fast forward
+update.
 +
-A lonely <src> parameter (without a colon and a destination) pushes
-the <src> to the same name in the destination repository.
+`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
 +
 Pushing an empty <src> allows you to delete the <dst> ref from
 the remote repository.
-- 
1.6.0.2.514.g23abd3
Previous: Anders MelchiorsenNext: Junio C Hamano
Message 4 of 5 in “Documentation: refine refspec description”
  1. 0/3 Documentation: refine refspec descriptionAnders Melchiorsen, Jan 25, 2009
  2. 1/3 Documentation: simplify refspec format descriptionAnders Melchiorsen, Jan 25, 2009
  3. 2/3 Documentation: more git push examplesAnders Melchiorsen, Jan 25, 2009
  4. 3/3 Documentation: rework src/dst description in git pushAnders Melchiorsen, Jan 25, 2009
  5. Junio C HamanoJan 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.