Git hash duplicates
问题 Git allows to retrieve the hash of the commit with commands like: git rev-parse HEAD which gives 33b316c or git rev-parse --short HEAD which gives 33b316cbeeab3d69e79b9fb659414af4e7829a32 I know that long hashes in practice will never collide. In practice, the short hashes are used much more often. I'd like to know what's the probability for the short ones to collide? Does git take any measures to overcome possible collisions (when for example using git checkout )? 回答1: I give a formula in my