GitHub lets you create SHA-256 repositories, in public preview
New repos can use SHA-256 object IDs instead of SHA-1, on github.com and GitHub Enterprise Cloud with data residency. You cannot convert an existing repository.
GitHub now lets you choose SHA-256 as a new repository’s hash algorithm, in public preview on github.com and GitHub Enterprise Cloud with data residency. Git has used SHA-1 to identify objects since the start, and SHAttered and other attacks exposed weaknesses in it years ago. SHA-256 repositories have existed in Git itself since version 2.30, released in December 2020, and GitHub says they will become the default for new repositories once Git 3.0 ships.
You pick the algorithm when you create a repository, either in the web interface or through the API, and the choice is permanent: GitHub says you cannot change a repository’s hash algorithm after creation, and existing repositories stay on SHA-1. SHA-256 object IDs are 64 hexadecimal characters, against 40 for SHA-1, so anything that reads object IDs from API responses or webhooks needs updating to handle both lengths. GitHub also recommends checking that Git 2.30 or later, and any other Git implementation you rely on such as libgit2, actually supports SHA-256 repositories.
Why it matters: this is the first time GitHub itself, rather than just Git, offers SHA-256 as a real option, which matters most for anyone who has to justify SHA-1 usage under a security policy. It is opt-in for now and only applies to brand-new repositories, so there is no migration decision to make for anything you already have.
The caveat: GitHub does not say in the post whether every feature, such as Actions or LFS, is fully compatible with SHA-256 repositories yet, so test before committing a new project to it.