AI TrackerGet the app
← All news
GitHub CopilotCoding

GitHub puts SHA-256 Git repositories in public preview

GitHub says support for Git repositories that use SHA-256 is now in public preview on github.com and GitHub Enterprise Cloud with data residency. It offers a more secure alternative to SHA-1 for new repositories.

  • Choice at creation: when creating a repository, you can pick SHA-1 or SHA-256 as its hash algorithm in the web interface or through the GitHub API. Cloning picks up the repository's algorithm automatically.
  • No switching: a repository's hash algorithm cannot be changed after creation, and existing repositories stay on SHA-1.
  • Compatibility: object IDs in SHA-256 repositories are 64 hexadecimal characters, against 40 for SHA-1. GitHub advises Git 2.30 or later, checking that other Git implementations such as libgit2 support SHA-256, and updating tooling that reads object IDs from API responses or webhooks to handle both lengths. A REST API endpoint reports a repository's hash algorithm.

GitHub notes SHA-256 repositories have been available in Git since 2.30 (December 2020) and are due to become the default for new repositories in Git 3.0.

Get news like this as a push.

AI Tracker alerts you when something changes for the tools you use.

Get the app