Interview Prep/Git & GitHub/Git internals: objects, refs and the index

What is the difference between SHA-1 and SHA-256 repositories?

IntermediateConceptGit internals: objects, refs and the index
Answer

<details> <summary><b>Answer</b></summary>

SHA-1 is the default and still used by GitHub, because SHA-1 collisions (SHAttered) are detected by hardened sha1dc in Git. SHA-256 repos (git init --object-format=sha256) use 64-hex IDs and are incompatible with SHA-1 repos at the protocol level, with interoperability still maturing. Most teams stay on SHA-1 today.

All Git & GitHub questions Roadmap: Git & GitHub

More on Git internals: objects, refs and the index