Skip to content
audiotale.net
Sign in
NewsNews

GitHub SHA-256 repositories in public preview: how to try them, what breaks and what's missing

GitHub now lets you create new repositories that use SHA-256 instead of SHA-1; the choice is permanent, object IDs grow to 64 characters, and migration is not available yet.

audiotale.net team

· 7 min read

Written by AI from the sources linked below. How we use AI

On this page
  1. Key points
  2. What to do
  3. What happened
  4. Background
  5. How it works
  6. What it means
  7. What we don't know yet
  8. What to watch next
  9. Sources

GitHub now lets you create new repositories that use SHA-256 instead of SHA-1 to name every commit, file and tag, as a public preview on github.com and on GitHub Enterprise Cloud with data residency. The choice is made when the repository is created, cannot be changed afterwards, and comes with a list of tools that may not cope yet. For most teams the right move this month is to try it on a throwaway repository, not to switch anything that matters.

Key points

  • GitHub announced SHA-256 Git repositories in public preview on 3 December 2026, for new repositories on github.com and GitHub Enterprise Cloud with data residency.
  • You pick SHA-1 or SHA-256 in the web interface or the API at creation; a repository's hash algorithm "can't change" afterwards, and existing repositories stay on SHA-1.
  • SHA-256 object IDs are 64 hexadecimal characters, against 40 for SHA-1, so anything that stores or validates IDs must handle both.
  • Git's own documentation says there is currently no interoperability between SHA-256 and SHA-1 repositories, and GitHub staff say migrating an existing repository is not available.
  • Git 3.0 is planned to make SHA-256 the default for newly created repositories, but Git's documentation says there is no planned release date yet.

What to do

This matters if you maintain tooling that reads Git object IDs, or if you want to test SHA-256 early.

  1. Check your Git version. GitHub's post requires Git 2.30 or later. git --version tells you.
  2. Try it on a scratch repository first. Create a new test repository on GitHub and choose SHA-256 in the creation form or API. Clones pick up the repository's hash algorithm automatically, according to GitHub, so you do not need to configure anything on clone.
  3. Find out which algorithm a repository uses. GitHub points to its REST endpoint "Get the hash algorithm for a repository". Locally, git rev-parse --show-object-format prints sha1 or sha256 (we confirmed this on Git 2.43).
  4. Audit anything that handles IDs. GitHub tells you to update tooling that reads object IDs from API responses, webhooks and similar sources so it accepts both 40 and 64 characters, and to confirm that other Git implementations you depend on, such as libgit2, support SHA-256. A regular expression like [0-9a-f]{40} in a CI script or webhook receiver is the classic breakage.
  5. Keep creating SHA-1 repositories if your environment is not ready; GitHub says that stays available.
  6. To experiment locally, git init --object-format=sha256 demo creates a SHA-256 repository. Git's documentation also lists the environment variable GIT_DEFAULT_HASH and the setting init.defaultObjectFormat for making it the default, which we do not recommend while the ecosystem catches up.

What happened

On 3 December 2026, GitHub's changelog announced that SHA-256 Git repositories are in public preview on github.com and on GitHub Enterprise Cloud with data residency. The post frames SHA-256 as a more secure alternative to SHA-1, whose weaknesses it says were exposed by attacks such as SHAttered. Its changelog entry does not mention GitHub Enterprise Server or any plan requirement, and we could not find either elsewhere.

You choose the algorithm when you create a repository in the web interface or through the GitHub API. Clones automatically use the algorithm of the repository on GitHub. The post states the main limits plainly: you cannot change a repository's hash algorithm after creating it, and existing repositories stay on SHA-1.

A maintainer's announcement in GitHub's community discussion repeats those points and invites feedback. In the same thread, a commenter posting as bk2204, who writes about GitHub's plans in the first person plural, says the API should return correct object IDs for each repository's algorithm, and that actions/checkout should already be compatible. On migration the same commenter is direct: it is not available, and the hope is that work in upstream Git "can go upstream relatively soon, which will start to unblock us". They add that in-place migration, including for repositories with submodules, needs upstream Git work that has not really started.

Background

Git names every object (commit, tree, file, tag) by a hash of its contents, and it has used SHA-1 since it was created. Google's security team announced the first practical SHA-1 collision on 23 February 2017, the SHAttered result that GitHub's post cites, and Git has been moving toward a stronger hash since. Git's design documents describe how the project picked SHA-256 in late 2018: a 256-bit hash with widely available implementations, with collision and second-preimage resistance, and speed as a tie-breaker, ahead of SHA-512/256, SHA-256x16, K12 and BLAKE2bp-256. Support shipped in Git 2.30 in December 2020.

Since then the gap has been the forges and tools around Git. Git's documentation for git init still says: "At present, there is no interoperability between SHA-256 repositories and SHA-1 repositories." The transition design document describes how interoperability could work, with a translation table that lets objects be named by either hash, but it is a design with a process it calls likely to change, and it makes adding SHA-256 to the Git network protocol a non-goal of that first design.

Git's list of planned breaking changes for 3.0 says new repositories will default to sha256, and ties that to the "ecosystem" being ready, including "popular Git libraries, applications and forges". It also states there is no plan to deprecate sha1, and that there is no planned release date for Git 3.0. A blog post from October put the release around April 2027, citing LWN; we could not check that, and Git's own page gives no date, so treat the date as unconfirmed. That post also reported that, at the time, pushing a SHA-256 repository to GitHub failed, and that GitLab and Forgejo already supported SHA-256. GitHub's preview now addresses the first of those gaps for new repositories.

How it works

SHA-1 repository SHA-256 repository
Object ID length 40 hex characters 64 hex characters
Default today in Git yes no (opt-in)
Default planned in Git 3.0 no yes, for new repositories
Convert existing repository on GitHub n/a not available

A commit ID is what you see in git log, in a pull request URL and in a webhook payload. With SHA-256 it is a longer string, which breaks any code with a hard-coded length. Because the ID is derived from the content, the same history gets entirely different IDs in the two formats. That is why a repository cannot just be switched: every commit would get a new name, and every reference to the old names (tags, signatures, issue links, CI caches) would point at nothing. Converting needs the translation machinery Git has only started to build, which is why GitHub says migration depends on upstream work.

Compatibility reports from community members in the discussion thread are the early warning to read. One user says most graphical Git clients, including GitKraken and VS Code, do not yet support SHA-256 repositories. Another reports VS Code showing SHA-256 commits as separate branches in its graph. A third reports that Prow's clonerefs step fails on SHA-256 repositories. These are user reports, not GitHub statements, and we have not reproduced them.

What it means

For most teams: nothing urgent. SHA-1 repositories keep working and stay the default for now. The concern with SHA-1 is a deliberately crafted collision, which is why the move matters for software supply chains more than for day-to-day work.

For tool and CI authors: this is the real work. Anything with {40} baked into a pattern, a database column sized for 40 characters or a library that predates SHA-256 support needs attention before your users create SHA-256 repositories. GitHub put the burden on tooling explicitly.

For security-sensitive projects: a SHA-256 repository is now possible on the largest forge, which one October blog post called the biggest blocker to the transition. The ability to convert an existing project is still missing.

For Git itself: a hosted preview on GitHub is the kind of ecosystem signal Git's own plan says it is waiting for before flipping the default.

What we don't know yet

  • When the preview becomes generally available, and whether GitHub Enterprise Server will get it. The announcement says neither.
  • Which GitHub features (Actions, Pages, code search and others) fully support SHA-256 repositories. The announcement does not list them, and the discussion thread addresses only actions/checkout.
  • When Git 3.0 ships, and so when SHA-256 becomes the default.
  • When migration will arrive. It depends on upstream Git work GitHub says has barely started.

What to watch next

  • GitHub's community discussion for fixes to the compatibility reports above.
  • Updates to GitHub's documentation and changelog as the preview moves toward general availability.
  • Git's Git 3.0 breaking-changes page for a release date.
  • Support in editors, graphical clients and CI platforms such as VS Code and Prow.

Sources

Written by

audiotale.net team

The official account of the people who run audiotale.net: announcements, conversation starters and the newsroom's drafts. Posts written with AI say so. Every other account here is a real person.