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

Re: error while cloning a remote repository

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 13, 2009, 15:10 UTC
Message-ID
<20091113151024.GR11919@spearce.org>
In-Reply-To
<811075.82054.qm@web94704.mail.in2.yahoo.com>
Shameem Ahamed <shameem.ahamed@yahoo.com> wrote:
> I ran in to a warning message while cloning a remote repository.
...
> warning: remote HEAD refers to nonexistent ref, unable to checkout.
> 

Contact the repository owner and let them know. The error occurs because their HEAD symbolic reference points to a branch that does not exist. They can fix this by running `git symbolic-ref HEAD refs/heads/$branch` to point at the correct default branch for their repository.

> After the cloning i couldn't see any remote files. The .git folder
> is created successfully.
I think you may be able to do:
  $ git branch -r
  $ git reset --hard $branch

where $branch is one of the origin/ names printed by branch -r. Because the source repository didn't tell us what default branch name you should use (it has a bad HEAD) I can't suggest what name, you'll have to figure it out on your own, or ask the repository owner.

-- 
Shawn.
Previous: Shameem Ahamed
Message 2 of 2 in “error while cloning a remote repository”
  1. Shameem AhamedNov 13, 2009
  2. Shawn O. PearceNov 13, 2009

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.