Git uses SHA-1 hashes of the contents of commits as their ids. I’ve wondered before what the probability is of a collision. According to Pro Git: (emphasis mine)
If all 6.5 billion humans on Earth were programming, and every second, each one was producing code that was the equivalent of the entire Linux kernel history (1 million Git objects) and pushing it into one enormous Git repository, it would take 5 years until that repository contained enough objects to have a 50% probability of a single SHA-1 object collision. A higher probability exists that every member of your programming team will be attacked and killed by wolves in unrelated incidents on the same night.
Good enough for me. The book also discusses what will happen in the event of a collision, but it’s less interesting.