Thanks. I am having trouble understanding how crypto would help (I did read [0]). The hash and the files are stored in the same repository. If an attacker edited a file, couldn't they update the hashes of that commit and everything related to it?
Think about what happens if you were to fork a copy of something on github and then rebase to edit one of the commits. If I pulled from your copy and the pulled from the official repo I'd get a merge (and probably some conflicts) because git identifies commits by their sha and uses that to decide what needs to be merged.
But if you managed to change one of your commits without changing the sha, then I'd have a much harder time detecting it, since when I pulled from another repo later there would be no merge (even though things were actually different).