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

Re: error: refs/remotes/origin/HEAD points nowhere!

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Mar 6, 2008, 07:50 UTC
Message-ID
<200803060950.44873.tlikonen@iki.fi>
In-Reply-To
<7v7iggn9ts.fsf@gitster.siamese.dyndns.org>
Junio C Hamano kirjoitti:
Show 19 quoted lines
> Teemu Likonen <tlikonen@iki.fi> writes:
> > After a while I start tracking some other remote repository. I do
> > this:
> >
> >   git remote add ng git://project-ng/project.git
> >
> > Then I do "git fetch ng" and probably also "git checkout --track -b
> > master-ng ng/master". Then I find the old "origin" useless to me so
> > I remove it with "git remote rm origin".
> >
> > It seems that refs/remotes/origin/HEAD is still left in my
> > repository and hence I keep getting these annoying error messages
> > all the time.
> >
> > Well, I know how to delete this file, but I believe that git should
> > have deleted it when I called "git remote rm origin". Am I right?
>
> Good analysis.  I would say "git remote rm" should have removed
> it and it would be a bug if it didn't.

Yes, "git remote rm <remote>" certainly doesn't remove the refs/remotes/<remote>/HEAD file. I can reproduce this bug anytime with current 'master' branch from git://git.kernel.org/pub/scm/git/git.git

Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 10 in “error: refs/remotes/origin/HEAD points nowhere!”
  1. Teemu LikonenMar 5, 2008
  2. Junio C HamanoMar 5, 2008
  3. Teemu LikonenMar 6, 2008
  4. builtin remote rm: remove symbolic refs, tooJohannes Schindelin, Mar 8, 2008
  5. Junio C HamanoMar 9, 2008
  6. Make "git remote rm <remote>" remove file refs/remotes/<remote>/HEADTeemu Likonen, Mar 7, 2008
  7. Teemu LikonenMar 7, 2008
  8. Junio C HamanoMar 8, 2008
  9. Junio C HamanoMar 8, 2008
  10. Teemu LikonenMar 8, 2008

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.