I am a newcomer to git and was quite happy until this evening. I have been committing changes regularly. I maintain two remotes on unfuddle and beanstalk and a local filesystem
I googled this error and found your page, in my case the problem was that I had done:
git clone --depth 1 https://github.com/example/nifty.git
but months later, forgetting that I had only grabbed the latest commits, when I tried to push it to another remote it complained. It took me a little while to figure out that it wasn't a damaged repo but just the fact that I never had the parent commits! Hopefully that helps someone.
This fixed it for my case:
git fetch --unshallow
"Dangling" objects may not be a problem. It could just mean that you've done some resetting, rebasing, and/or deleted branches that weren't fully merged. "Missing", on the other hand, is more serious, I believe. Take a look at this article on repairing a damaged repo. That might help you out. You could also try upgrading git if you're out of date. A newer version might be a little smarter.