Git development
 help / color / mirror / Atom feed
From: "Lasse Kliemann" <lasse-gmane-git-2009@mail.plastictree.net>
To: git@vger.kernel.org
Subject: git-push: creating branch on remote, refspec format
Date: Thu, 26 Feb 2009 12:00:55 +0000 (UTC)	[thread overview]
Message-ID: <go609m$3dj$2@ger.gmane.org> (raw)

http://www.kernel.org/pub/software/scm/git/docs/git-push.html reads:

| git push origin master:refs/heads/experimental
| 
|   Create the branch experimental in the origin repository by copying the 
|   current master branch. This form is only needed to create a new branch or 
|   tag in the remote repository when the local name and the remote name are 
|   different; otherwise, the ref name on its own will work.

It appears to me that the ref name on its own will also work to create a new 
branch, at least with local repositories:

$ (mkdir a && cd a && git init)
Initialized empty Git repository in /tmp/a/.git/
$ mkdir b && cd b && git init
Initialized empty Git repository in /tmp/b/.git/
$ pwd
/tmp/b
$ touch x && git add x && git commit 
[master (root-commit)]: created 87a90f5: "NA"
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 x

Now the push from '/tmp/b' to '/tmp/a':

$ git push /tmp/a master:foo
Counting objects: 3, done.
Writing objects: 100% (3/3), 209 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /tmp/a
 * [new branch]      master -> foo

Am I missing something?

             reply	other threads:[~2009-02-26 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26 12:00 Lasse Kliemann [this message]
2009-02-26 12:08 ` git-push: creating branch on remote, refspec format Michael J Gruber
2009-02-26 13:18   ` Jeff King

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='go609m$3dj$2@ger.gmane.org' \
    --to=lasse-gmane-git-2009@mail.plastictree.net \
    --cc=git@vger.kernel.org \
    /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