Skip to content

Gitでreftableとsha256を試す

gitのconfig推奨設定を試してみる。

既存のリポジトリでも git clone するときにオプションで reftable を使うよう構成できる。

Terminal window
git clone --ref-format=reftable https://github.com/lufia/qsh.git

git clone には —object-format= オプションが無いので最初から。しかし2025年3月時点では、GitHubが対応していなかった。

Terminal window
$ git init --object-format=sha256 [--ref-format=reftable]
$ git remote add origin https://github.com/lufia/git-sha256.git
$ git commit -m 'first commit'
[main (root-commit) 867d8e2] first commit
1 file changed, 1 insertion(+)
create mode 100644 README.md
$ git push -u origin main
fatal: the receiving end does not support this repository's hash algorithm
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://github.com/lufia/git-sha256.git'

compatObjectFormat を設定すればいけるか?

Terminal window
$ git config extensions.compatObjectFormat sha1
$ git push -u origin main
fatal: the receiving end does not support this repository's hash algorithm
fatal: the remote end hung up unexpectedly
error: failed to push some refs to 'https://github.com/lufia/mofu.git'

2025-03-20時点では設定してもだめだった。