git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: error with $ git push origin HEAD:newbranch

From
Cchris <jugg@hotmail.com>
Date
May 5, 2011, 10:06 UTC
Message-ID
<loom.20110505T114511-660@post.gmane.org>
In-Reply-To
<20110505093752.GB29595@sigill.intra.peff.net>
Jeff King <peff <at> peff.net> writes:
Show 6 quoted lines
> 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
Previous: Jeff KingNext: Jeff King
Message 3 of 11 in “error with $ git push origin HEAD:newbranch”
  1. chrisMay 5, 2011
  2. Jeff KingMay 5, 2011
  3. chrisMay 5, 2011
  4. Jeff KingMay 5, 2011
  5. chrisMay 6, 2011
  6. Junio C HamanoMay 6, 2011
  7. chrisMay 6, 2011
  8. Jeff KingMay 6, 2011
  9. chrisMay 10, 2011
  10. Jeff KingMay 10, 2011
  11. chrisMay 11, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.