I have a git repository that has a remote set up ("git fetch" works), but it doesn't have any remote branches: the ".git/refs/remotes" folder doesn't exist, and
git branch -r
returns nothing (empty list, no branches). Yet the actual remote repository does have a branch. If I re-clone the remote repo, I get another local repo that does have remote branches.
I didn't think this state was possible. My questions:
- How on earth did I get into this state?
- Is there a command that can be run to put ".git/refs/remotes" back? (short of a fresh clone, which I've done already).
Additional Information
"git config --get remote.origin.fetch" is blank (i.e. the command produces no output)
"git remote show origin" shows
$ git remote show origin
* remote origin
Fetch URL: <correct remote url here>
Push URL: <correct remote url here>
HEAD branch: master
Local ref configured for 'git push':
master pushes to master (up to date)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…