What is the SHA-1 to SHA-256 transition in Git about, and why is it happening?

Last updated 6 July 2026

  • SHA-1, which names every Git object, is cryptographically broken: practical collision attacks (SHAttered) undermine Git's integrity guarantees.

  • The transition adds SHA-256 object names (64 hex chars) via git init --object-format=sha256.

  • Adoption is slow because SHA-256 repos can't freely interoperate with SHA-1 repos and tooling lags. Most repos remain SHA-1 today.

  • https://blog.gitbutler.com/git-3-sha-256
  • https://git-scm.com/docs/hash-function-transition
  • https://antoniocortes.com/en/git-3-sha-256/
  • https://dev.to/jamilxt/git-30-is-switching-to-sha-256-one-git-co-creator-says-it-will-be-a-costly-mistake-p7d
  • https://www.kernel.org/pub/software/scm/git/docs/technical/hash-function-transition.html
  • https://github.com/orgs/community/discussions/12490
  • https://about.gitlab.com/blog/sha256-support-in-gitaly/
  • https://www.youtube.com/watch?v=cS0F7TeN2tk
All Git interview questions