GitHub opens public preview of SHA-256 Git repositories, with GitHub Enterprise Cloud data residency supported
GitHub has launched a public preview of Git repositories that use SHA-256 instead of SHA-1, on GitHub and GitHub Enterprise Cloud with data residency. New repositories can choose either algorithm at creation; the choice cannot be changed later.
Why it matters
Git has identified objects with SHA-1 since the beginning. GitHub says attacks such as SHAttered exposed weaknesses in that algorithm, so Git added SHA-256 repositories, which have been available since Git 2.30 in December 2020 and will become the default for new repositories in Git 3.0.
According to GitHub, the preview gives new repositories a more secure alternative to SHA-1. When a repository is created, the hash algorithm can be picked in the web interface or through the API, and clones use the same algorithm automatically. Object IDs grow from 40 to 64 hexadecimal characters. Existing repositories keep SHA-1.
GitHub advises checking readiness first: use Git 2.30 or later, confirm other Git implementations such as libgit2 support SHA-256, and update tooling that parses object IDs from API responses or webhooks so it handles both lengths. A REST API endpoint reports which algorithm a repository uses. Teams not ready can keep creating SHA-1 repositories.