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

[PATCH 6/5] git-push: Update description of refspecs and add examples

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 10, 2007, 06:59 UTC
Message-ID
<7vk5ucb8hm.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<11813808973041-git-send-email-gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * This is primarily to describe the semantics [Patch 5/5] fixes.
 Documentation/git-push.txt |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 366c5db..665f6dc 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -53,9 +53,8 @@ side are updated.
 +
 `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
 +
-A parameter <ref> without a colon is equivalent to
-<ref>`:`<ref>, hence updates <ref> in the destination from <ref>
-in the source.
+A parameter <ref> without a colon pushes the <ref> from the source
+repository to the destination repository under the same name.
 +
 Pushing an empty <src> allows you to delete the <dst> ref from
 the remote repository.
@@ -98,6 +97,26 @@ the remote repository.
 
 include::urls.txt[]
 
+
+Examples
+--------
+
+git push origin master::
+	Find a ref that matches `master` in the source repository
+	(most likely, it would find `refs/heads/master`), and update
+	the same ref (e.g. `refs/heads/master`) in `origin` repository
+	with it.
+
+git push origin :experimental::
+	Find a ref that matches `experimental` in the `origin` repository
+	(e.g. `refs/heads/experimental`), and delete it.
+
+git push origin master:satellite/master::
+	Find a ref that matches `master` in the source repository
+	(most likely, it would find `refs/heads/master`), and update
+	the ref that matches `satellite/master` (most likely, it would
+	be `refs/remotes/satellite/master`) in `origin` repository with it.
+
 Author
 ------
 Written by Junio C Hamano <junkio@cox.net>, later rewritten in C
-- 
1.5.2.1.938.gac3b4
Previous: Junio C Hamano
Message 6 of 6 in “remote.c: refactor match_explicit_refs()”
  1. 1/5 remote.c: refactor match_explicit_refs()Junio C Hamano, Jun 9, 2007
  2. 2/5 remote.c: refactor creation of new dst refJunio C Hamano, Jun 9, 2007
  3. 3/5 remote.c: minor clean-up of match_explicit()Junio C Hamano, Jun 9, 2007
  4. 4/5 remote.c: fix "git push" weak match disambiguationJunio C Hamano, Jun 9, 2007
  5. 5/5 remote.c: "git-push frotz" should update what matches at the source.Junio C Hamano, Jun 9, 2007
  6. 6/5 git-push: Update description of refspecs and add examplesJunio C Hamano, Jun 10, 2007

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.