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

builtin-remote bug: Stale tracking branch after "git clone"

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Mar 14, 2008, 07:51 UTC
Message-ID
<200803140951.36514.tlikonen@iki.fi>
Hi

I have found a recently added bug. I'm using git version 1.5.4.4.537.gb75aa ('master' branch). I can't describe it technically so I just type instructions how to reproduce it:

1) Clone some git repository. I think any repo will do.
2) Type "git remote show origin" in that cloned repo. You'll see 
something like this:
* remote origin
  URL: [...]
  Remote branch merged with 'git pull' while on branch master
    master
  Stale tracking branch (use 'git remote prune')
    HEAD
  Tracked remote branch
    master

$ find .git/refs/remotes .git/refs/remotes/ .git/refs/remotes/origin .git/refs/remotes/origin/HEAD .git/refs/remotes/origin/master

3) As git asked, type "git remote prune origin".
4) Do "git remote show origin" again and it will display this:
* remote origin
  URL: [...]
  Remote branch merged with 'git pull' while on branch master
    master
  New remote branch (next fetch will store in remotes/origin)
    master [Hmm, interesting]
Seems like .git/refs/remotes/origin/master was deleted:

$ find .git/refs/remotes/ .git/refs/remotes/ .git/refs/remotes/origin .git/refs/remotes/origin/HEAD

5) Now fetch that "new" remote branch again with "git fetch" and you'll 
see this:
error: refs/remotes/origin/HEAD points nowhere!
From [...]
 * [new branch]      master     -> origin/master
6) Now we're back in the beginning. See item 2.
Message 1 of 1 in “builtin-remote bug: Stale tracking branch after "git clone"”
  1. Teemu LikonenMar 14, 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.