Codiatech Blog

What to Test Before Creating a SHA-256 Repository on GitHub

Pilot GitHub's SHA-256 repository preview with a new repository and test how Git clients, webhook receivers and release records handle longer object IDs.

Illustration of a branching Git commit graph and object identifiers of different lengths.

GitHub has opened a public preview of SHA-256 for new Git repositories. When creating a repository in the web interface or through the API, you can choose SHA-1 or SHA-256. The choice matters for platform and software teams that pass Git object IDs through CI jobs, webhook receivers or release records. GitHub announcement.

Test 40- and 64-Character IDs Through the Same Workflow

Full object IDs are 40 hexadecimal characters in SHA-1 repositories and 64 in SHA-256 repositories. Create two low-risk test repositories and take the same sample code change through each workflow. In both cases, verify that you can trace the release record back to the correct commit.

  • Git clients. Check developer machines, CI images and embedded Git libraries separately. GitHub specifies Git 2.30 or later for general SHA-256 use and Git 2.41 or later to clone an empty SHA-256 repository.
  • Webhook and API consumers. Look for fixed 40-character assumptions wherever a component reads, stores or reports an ID. Include the all-zero IDs used when branches or tags are created or deleted.
  • Deployment records. Verify that the full ID from CI reaches the package record and deployment log intact.

A webhook receiver, for example, can accept a request and still truncate the ID when saving it. Check the stored value against the original once the event has finished processing.

Compatibility test diagram showing commit, terminal, webhook and CI validation stages.

What Does the Preview Allow for Existing Repositories?

A GitHub repository's hash algorithm is fixed at creation. Git cannot directly push or fetch between repositories using different hash algorithms. Run the preview in a new repository and inventory any automation that still depends on existing SHA-1 repositories. GitHub repository documentation.

Consider SHA-256 for new projects once the clients and integrations you rely on have passed the acceptance test. For help mapping the repositories behind shared CI tools and release records, see Codiatech's technology consulting service.

Primary source: blog.github.com