Re: error with $ git push origin HEAD:newbranch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 05, 2011 at 10:06:21AM +0000, chris wrote:

> Yes, indeed.  I suppose it must be the situation that I've never done that
> before then.  While I certainly I have pushed a detached head before, it must 
> have always been to an existing branch.
> 
> Thanks for clarifying this.
> 
> It is slightly surprising that git-push doesn't default to assuming one means 
> refs/heads/newbranch in this case.  I don't see a reason not to?

Consider something like:

  $ git checkout v1.5
  $ git push origin HEAD:foo

Would you want "foo" to be a branch or a tag? I can see arguments for
either.

Rather than trying to guess, it's fairly easy to disambiguate. For a
branch, either:

  $ git push origin HEAD:refs/heads/foo

or

  $ git branch foo
  $ git push origin HEAD

would work, depending on whether or not you want a local branch.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]