aboutsummaryrefslogtreecommitdiff
path: root/Documentation/git-push.txt
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-06 00:44:08 -0400
committerJunio C Hamano <gitster@pobox.com>2007-09-05 23:25:09 -0700
commit4e560158c6de154fafab9fc3f6028d9edcc53e6b (patch)
treed26d602d7538a0547b249eec0bc2e7f40c7596f7 /Documentation/git-push.txt
parent432e93a16441a1a11aeb8158a634f76c214abb31 (diff)
downloadgit-4e560158c6de154fafab9fc3f6028d9edcc53e6b.tar.gz
git-4e560158c6de154fafab9fc3f6028d9edcc53e6b.tar.xz
Include a git-push example for creating a remote branch
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-push.txt')
-rw-r--r--Documentation/git-push.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 0dd9caf86..7b8e075c4 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