Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: git-push: creating branch on remote, refspec format

From: Jeff King <hidden>
Date: 2016-06-15 22:46:17

On Thu, Feb 26, 2009 at 01:08:29PM +0100, Michael J Gruber wrote:
quoted
$ git push /tmp/a master:foo
[...]

You're using the very same form as the doc. "This form" in the doc
refers to "repo refspec", i.e. something like "a b:c", which is what you
use. The "refs/heads/" part is just there to disambiguate between
possible different matches on the remote side (refs/heads/foo,
refs/tags/foo, refs/remotes/bar/foo, ...).
Actually, it used to be that case that git would complain unless "foo"
was properly qualified; this was fixed in f8aae12 (push: allow
unqualified dest refspecs to DWIM, 2008-04-23), which is in v1.5.5.2.

The doc in question was added around v1.5.3. So I think it is simply
that it was never updated to match the new behavior. That paragraph
could probably even just be deleted, since there is no syntactic
difference between pushing to an existing branch and creating a new
branch (alternatively, it can say explicitly that creating a new branch
is the same as pushing to one).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help