Git 1,932 chose SHA-256 as SHA-1's successor in 2018 and can create SHA-256 repositories since Git 2.29 (2020). The object model is unchanged; only the hash and the name length (64 hex digits) differ:
cd ..
git init -q --object-format=sha256 sha256-lab
cd sha256-lab
echo 'BookNest' | git hash-object --stdin
git config get core.repositoryformatversion
git config get extensions.objectformat
git commit -q --allow-empty -m "Start"
git fetch ../objects-lab main668884b4c72057afaa8b8ce40ef4f73244be34904646194df9f8223be3bed7ca 1 sha256 fatal: mismatched algorithms: client sha256; server sha1
Format version 1 tells Git to honor the extensions.* keys and to refuse any repository with an extension it does not know, so an old Git stops instead of corrupting data. The last line is the catch: SHA-1 and SHA-256 repositories cannot exchange objects. extensions.compatObjectFormat=sha1, in development since Git 2.45, will translate between them. Until the protocol supports SHA-256, the Git project discourages it on public servers and no major host accepts it, so BookNest stays on SHA-1. Git 3.0, with no date yet, makes SHA-256 the default for new repositories and keeps supporting SHA-1.