#1863·go-git

sha256: Add support for `compatObjectFormat`

Author: pjbgfCreated Feb 24, 2026Updated Sep 13, 2026
Labelsenhancementno-autoclose

Feature Description

The TL;DR of the feature:

a SHA-256 repository stores a bidirectional mapping between SHA-256 and SHA-1 object names. The mapping is generated locally and can be verified using "git fsck". Object lookups use this mapping to allow naming objects using either their SHA-1 and SHA-256 names interchangeably.

Fetches from a SHA-1 based server convert the fetched objects into SHA-256 form and record the mapping in the bidirectional mapping table (see below for details). Pushes to a SHA-1 based server convert the objects being pushed into SHA-1 form so the server does not have to be aware of the hash function the client is using.

For full details refer to the upstream documentation references below.

Implementation break-down:

  • Bidirectional (SHA-1 <-> SHA-256) mapping table
  • Fetching from SHA1 server
  • Pushing to SHA1 server
  • Support in storage/memory
  • Support in storage/filesystem

Upstream references:

Follow-up from #706.