Re: error with $ git push origin HEAD:newbranch

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

 



Jeff King <peff <at> peff.net> writes:
> On Thu, May 05, 2011 at 08:47:39AM +0000, chris wrote:
> 
> > $ git push origin HEAD:newbranch
> > error: unable to push to unqualified destination: newbranch
> > The destination refspec neither matches an existing ref on the remote nor
> > begins with refs/, and we are unable to guess a prefix based on the source 
ref.
> > error: failed to push some refs to 'ssh://example.com/srv/git/project.git'
> > 
... 
> However, you may see that message if you are on a detached head instead
> of a branch. Might that be the case here?

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?

chris


--
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]