git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Johnsen <chris_johnsen@pobox.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Chris Johnsen <chris_johnsen@pobox.com>
Subject: [PATCH] git-push.txt: describe how to default to pushing only current branch
Date: Fri, 13 Mar 2009 20:27:31 -0500	[thread overview]
Message-ID: <1236994051-27346-1-git-send-email-chris_johnsen@pobox.com> (raw)
In-Reply-To: <20090313164941.GA16504@sigill.intra.peff.net>

---
Jeff King <peff@peff.net> writes:
>   git config remote.$remote.push HEAD
> 
> It isn't mentioned in the git-push manpage; maybe a documentation
> patch to give an example using HEAD would make sense?

Here is a patch. It also attempts to document bare 'git push'.

In the resulting manpage the inline commands are not very
obvious (the HTML looks OK though). There is some sort of
formatting in there, but it does not seem to display any
differently from the surrounding text when I use man to view it
on my system.  Would it be better to do something like wrap
double quotes around the inline commands to help readers viewing
the manpage?
---
 Documentation/git-push.txt |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 4e7e5a7..fd53c49 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -24,8 +24,8 @@ every time you push into it, by setting up 'hooks' there.  See
 documentation for linkgit:git-receive-pack[1].
 
 
-OPTIONS
--------
+OPTIONS[[OPTIONS]]
+------------------
 <repository>::
 	The "remote" repository that is destination of a push
 	operation.  This parameter can be either a URL
@@ -187,6 +187,28 @@ reason::
 Examples
 --------
 
+git push::
+	Works like `git push <remote>`, where <remote> is the
+	current branch's remote (or `origin`, if no remote is
+	configured for the current branch).
+
+git push origin::
+	Without additional configuration, works like
+	`git push origin :`.
++
+The default behavior of this command when no <refspec> is given can be
+configured by setting the `push` option of the remote.
++
+For example, to default to pushing only the current branch to `origin`
+use `git config remote.origin.push HEAD`.  Any valid <refspec> (like
+the ones in the examples below) can be configured as the default for
+`git push origin`.
+
+git push origin :::
+	Push "matching" branches to `origin`. See
+	<refspec> in the <<OPTIONS,OPTIONS>> section above for a
+	description of "matching" branches.
+
 git push origin master::
 	Find a ref that matches `master` in the source repository
 	(most likely, it would find `refs/heads/master`), and update
-- 
1.6.2

  reply	other threads:[~2009-03-14  1:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13  7:48 Not pushing all branches? Peter Krefting
2009-03-13  8:12 ` Imran M Yousuf
2009-03-13  9:44   ` Peter Krefting
2009-03-13 10:49     ` Johannes Schindelin
2009-03-13 11:38     ` Finn Arne Gangstad
2009-03-13  8:25 ` John Tapsell
2009-03-13 10:51   ` Johannes Schindelin
2009-03-13 12:37     ` John Tapsell
2009-03-13 13:53       ` Johannes Schindelin
2009-03-13 13:56         ` John Tapsell
2009-03-13 15:48           ` Michael J Gruber
2009-03-13 16:00           ` Johannes Schindelin
2009-03-13 20:02   ` Junio C Hamano
2009-03-14  1:08     ` Miles Bader
2009-03-17  8:24       ` Jeff King
2009-03-13 16:49 ` Jeff King
2009-03-14  1:27   ` Chris Johnsen [this message]
2009-03-14 19:26     ` [PATCH] git-push.txt: describe how to default to pushing only current branch Junio C Hamano
2009-03-14 20:34       ` Jeff King
2009-03-14 20:56         ` Jeff King
2009-03-15  2:49           ` Chris Johnsen
2009-03-15 11:30             ` [PATCH] git-push.txt: describe how to default to pushing only Chris Johnsen
2009-03-17  7:46             ` [PATCH] git-push.txt: describe how to default to pushing only current branch Jeff King
2009-03-14 21:25         ` Junio C Hamano
2009-03-14 21:46           ` Jeff King
2009-03-16  4:51             ` Junio C Hamano
2009-03-15  2:32       ` [PATCH v2] " Chris Johnsen

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=1236994051-27346-1-git-send-email-chris_johnsen@pobox.com \
    --to=chris_johnsen@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).