{"thread":{"id":"12684","subject":"builtin-remote bug: Stale tracking branch after \"git clone\"","startedAt":"2008-03-14T07:51:36Z","lastAt":"2008-03-14T07:51:36Z","messageCount":1,"participants":["Teemu Likonen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"72044","messageId":"200803140951.36514.tlikonen@iki.fi","threadId":"12684","inReplyTo":null,"subject":"builtin-remote bug: Stale tracking branch after \"git clone\"","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-03-14T07:51:36Z","receivedAt":"2008-03-14T07:51:36Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Hi\n\nI have found a recently added bug. I'm using git version \n1.5.4.4.537.gb75aa ('master' branch). I can't describe it technically \nso I just type instructions how to reproduce it:\n\n\n1) Clone some git repository. I think any repo will do.\n\n2) Type \"git remote show origin\" in that cloned repo. You'll see \nsomething like this:\n\n* remote origin\n  URL: [...]\n  Remote branch merged with 'git pull' while on branch master\n    master\n  Stale tracking branch (use 'git remote prune')\n    HEAD\n  Tracked remote branch\n    master\n\n$ find .git/refs/remotes\n.git/refs/remotes/\n.git/refs/remotes/origin\n.git/refs/remotes/origin/HEAD\n.git/refs/remotes/origin/master\n\n3) As git asked, type \"git remote prune origin\".\n\n4) Do \"git remote show origin\" again and it will display this:\n\n* remote origin\n  URL: [...]\n  Remote branch merged with 'git pull' while on branch master\n    master\n  New remote branch (next fetch will store in remotes/origin)\n    master [Hmm, interesting]\n\nSeems like .git/refs/remotes/origin/master was deleted:\n\n$ find .git/refs/remotes/\n.git/refs/remotes/\n.git/refs/remotes/origin\n.git/refs/remotes/origin/HEAD\n\n5) Now fetch that \"new\" remote branch again with \"git fetch\" and you'll \nsee this:\n\nerror: refs/remotes/origin/HEAD points nowhere!\nFrom [...]\n * [new branch]      master     -> origin/master\n\n6) Now we're back in the beginning. See item 2.\n"}]}