After test-driving a git GUI application (SmartGit, in case it makes a difference), I've noticed that my
.git/refs/heads directory contains only "master" (there should be three other branches listed), and my
.git/refs/tags directory is completely empty. This is in my local copy, the project itself is hosted on GitHub. When I browse it on GitHub, (thankfully) everything is still there.
What's the best way to restore my local branch and tag information? I know that the files in those directories just contain the SHA of the object they point to, but I'm a fairly basic-level git user.
It seems that your .git/config file has gone missing since it stores information about local branches and what branches they are tracking. You need to checkout these branches again like this:
git checkout --track origin/branch1 git checkout --track origin/branch2
This will recreate the branches and make sure they track the remote branches. To update your tags you need to do:
git fetch --tags
git branch -a print? The refs may have been packed by git.