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

1 messages from 2008-03-14 to 2008-03-14. Participants: Teemu Likonen.
Thread: https://gitlist.dev/t/12684

## Teemu Likonen, 2008-03-14 07:51

Subject: builtin-remote bug: Stale tracking branch after "git clone"
Message-ID: <200803140951.36514.tlikonen@iki.fi>
URL: https://gitlist.dev/e/200803140951.36514.tlikonen%40iki.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.

```
