GitHub now lets you choose SHA-256 when creating a new repository. Before selecting it, check your local Git installation, graphical client and scripts that consume object IDs. Existing repositories keep SHA-1; this feature does not switch them automatically.
The public preview was announced on December 3, 2026, for github.com and GitHub Enterprise Cloud with data residency. This guide provides a small local test and a compatibility checklist, without moving an existing project. GitHub announcement.
What does SHA-256 change?
Git stores history as objects, including commits, directory trees and file contents. Each object has an identifier calculated from its data. SHA-1 and SHA-256 are two algorithms for producing that hash. They do not encrypt your code or replace access controls.
A full SHA-1 object ID contains 40 hexadecimal characters; a SHA-256 ID contains 64. Suppose an internal deployment form accepts only 40-character revision IDs. Your new repository might work in the terminal while the form rejects a valid identifier. That is why the surrounding tools need checking before you select a format. Repository documentation.
Check your Git version and repository format
GitHub requires Git 2.30 or later for SHA-256 repositories. Cloning an empty SHA-256 repository requires at least Git 2.41. That separate requirement matters when you are starting a project. Check other Git implementations and graphical clients independently: a working command-line Git installation does not prove your entire toolchain is compatible. GitHub requirements.
In a terminal, run:
git --version
git -C /path/to/repo rev-parse --show-object-format
Replace the path with your project directory. The second command reports the object storage format, such as sha1 or sha256. Do not infer the algorithm from the length of an arbitrary identifier: Git also uses abbreviated IDs. git rev-parse reference.
A reproducible test without a GitHub account
This example targets Bash, such as a Linux terminal. Run it in a working directory where neither git-sha1-demo nor git-sha256-demo exists. It creates two fresh local repositories and sends no data to the internet.
git init -q --object-format=sha1 git-sha1-demo
git init -q --object-format=sha256 git-sha256-demo
git -C git-sha1-demo rev-parse --show-object-format
git -C git-sha256-demo rev-parse --show-object-format
printf 'sygnal-check\n' | git -C git-sha1-demo hash-object --stdin
printf 'sygnal-check\n' | git -C git-sha256-demo hash-object --stdin
We checked these operations on December 4, 2026, using Git 2.56.1 on Linux x86_64. With exactly that input, the results were:
| Format | File-content object ID |
|---|---|
sha1 | fa5fb1a2938d4390508eff3f24e1bb5df9199926 |
sha256 | b0bf216215146966b440e2eb64acb57d781fd58459dd4760f7079d10ec7f3a75 |
These identify blob objects, meaning file contents, rather than commits. Without -w, the command calculates the identifier without storing that object. Changing the text or its line ending changes the result. See git init for repository creation and git hash-object for hashing behavior.
This test verifies the local commands. We did not test repository creation on a GitHub account, remote pushes, graphical clients or hosted CI. You can remove the demonstration folders afterwards, once you have checked that they contain nothing you need.
What should you test before creating a project?
The following is an editorial checklist. Use a separate test project with the same tools your real work depends on.
| Area | A check with a concrete result |
|---|---|
| Terminal and IDE | Open the project, change a file, make a commit and read its history. |
| CI and releases | Complete a test build and release without production data. |
| Custom scripts | Look for 40-character validation, ID truncation and database field limits. |
| Integrations | Pass a full ID through your form, API, webhook and issue tracker. |
| Backup and recovery | Restore the test project and check that it remains usable. |
For a GitHub integration, you can query GET /repos/OWNER/REPO/hash-algorithm. The documentation shows a response containing hash_algorithm. Private repositories require suitable authorization. This describes the official API; we did not execute that endpoint in this test. REST reference.
Should you switch an existing project?
GitHub does not let you change an existing repository's hash algorithm in place. Git also cannot directly push or fetch between repositories using different algorithms. Creating a new remote is therefore not a complete migration procedure. GitHub limitations.
We also attempted a local fetch from a SHA-256 repository into a SHA-1 repository, each containing one empty commit. Git 2.56.1 returned exit code 128 and fatal: mismatched algorithms: client sha1; server sha256. This was a controlled format-compatibility check, not a history-migration test.
For a new, independent project, start with a compatibility trial. If an essential integration fails, you can still create a SHA-1 repository. Avoid rewriting a working project solely to select the new option: first establish which concrete problem that change would solve.
Related reading
Sources and local checks verified on December 4, 2026. GitHub's feature remains in public preview and may change.
