Security

GitHub Now Lets You Create SHA-256 Git Repositories, in Public Preview

Leave a comment

GitHub says SHA-256 Git repositories are now in public preview on github.com and GitHub Enterprise Cloud with data residency.

  • When you create a repo, you can now pick SHA-1 or SHA-256 in the web UI or the API. You can’t change it later, and existing repos stay SHA-1.
  • Cloning automatically uses whatever the repo uses.
  • SHA-256 object IDs are 64 hex characters instead of 40, so any tooling that parses commit IDs from webhooks or API responses needs to handle both.
  • You need Git 2.30 or later, and other implementations you use (like libgit2) need SHA-256 support. Git 3.0 will make SHA-256 the default for new repos.

My take

SHA-1’s weaknesses have been public since SHAttered, so this is overdue and welcome. I wouldn’t flip important repos yet. The thing that will bite people is scripts and CI that assume 40-character hashes. I wrote a quick how-to for trying it locally first.

God Bless, and Happy hacking!

References & Further Reading

Subscribe (RSS) Follow News via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.