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