GitHub has opened public preview of SHA-256 Git repositories on github.com and GitHub Enterprise Cloud with data residency. SHA-256 offers a more secure alternative to SHA-1, whose weaknesses have been highlighted by cryptographic advances and attacks such as SHAttered. Git has supported SHA-256 repositories since version 2.30, released in 2020, and plans to make SHA-256 the default for new repositories in Git 3.0.
When creating a repository through GitHub’s website or API, users can now select SHA-1 or SHA-256. Cloning automatically uses the repository’s existing hash algorithm. The choice is permanent: repositories cannot switch algorithms after creation, and existing GitHub repositories remain on SHA-1. Before adopting SHA-256, teams should use Git 2.30 or later and verify that other Git implementations and tools support it. SHA-256 object IDs contain 64 hexadecimal characters instead of SHA-1’s 40, so integrations that process IDs from APIs, webhooks, or other sources must handle both formats. The repository REST API can identify which algorithm is in use; users whose environments are not ready can continue creating SHA-1 repositories.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.