Git (since 1.8.3) now has an official way to fetch the full history of a shallow clone:
git fetch --unshallow
From the git fetch documentation:
--unshallow
If the source repository is complete, convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories.
If the source repository is shallow, fetch as much as possible so that the current repository has the same history as the source repository.