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.
More on Git internals: objects, refs and the index
What are the four object types in Git's object database?BeginnerIs Git a snapshot system or a diff system?BeginnerWhat is the SHA-1 (or SHA-256) hash of an object and how is it computed?BeginnerWhere does Git store objects on disk, and what are loose objects versus packfiles?IntermediateWhat exactly is a branch, and what does creating one cost?IntermediateWhat is HEAD?Beginner