git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Include a git-push example for creating a remote branch
@ 2007-09-06  4:44 Shawn O. Pearce
  2007-09-06  4:54 ` Miles Bader
  2007-09-06 10:50 ` Wincent Colaiuta
  0 siblings, 2 replies; 9+ messages in thread
From: Shawn O. Pearce @ 2007-09-06  4:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Many users get confused when `git push origin master:foo` works
when foo already exists on the remote repository but are confused
when foo doesn't exist as a branch and this form does not create
the branch foo.

This new example highlights the trick of including refs/heads/
in front of the desired branch name to create a branch.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 Documentation/git-push.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 0dd9caf..7b8e075 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -117,6 +117,12 @@ git push origin master:satellite/master::
 	the ref that matches `satellite/master` (most likely, it would
 	be `refs/remotes/satellite/master`) in `origin` repository with it.
 
+git push origin master:refs/heads/experimental::
+	Create the branch `experimental` in the `origin` repository
+	by copying the current `master` branch.  This form is usually
+	needed to create a new branch in the remote repository as
+	there is no `experimental` branch to match.
+
 Author
 ------
 Written by Junio C Hamano <junkio@cox.net>, later rewritten in C
-- 
1.5.3.1.840.g0fedbc

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-06 17:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-06  4:44 [PATCH] Include a git-push example for creating a remote branch Shawn O. Pearce
2007-09-06  4:54 ` Miles Bader
2007-09-06  5:01   ` Shawn O. Pearce
2007-09-06  5:57     ` Miles Bader
2007-09-06  6:30       ` Junio C Hamano
2007-09-06 15:48         ` Carl Worth
2007-09-06 17:42           ` Junio C Hamano
2007-09-06 10:50 ` Wincent Colaiuta
2007-09-06 14:57   ` Kristian Høgsberg

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).