TL;DR

GitHubからgitプロトコル(git://github.comで始まるURL)でgit cloneする設定になっている人が居たらSSHプロトコル(git@github.comで始まるURL)を使うように設定変更しましょう


wez/weztermという端末エミュレータを知って、使ってみようかと思い、ドキュメントに従ってbrew tapしたときのことでした。次の様なエラーが発生して、tapできません。

$ brew tap wez/wezterm==> Tapping wez/weztermCloning into '/opt/homebrew/Library/Taps/wez/homebrew-wezterm'...fatal: remote error:   The unauthenticated git protocol on port 9418 is no longer supported.Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.Error: Failure while executing; `git clone https://github.com/wez/homebrew-wezterm /opt/homebrew/Library/Taps/wez/homebrew-wezterm --origin=origin --template=` exited with 128.

指定された記事を見てみると、git://で始まるURLでのアクセス==gitプロトコルでのアクセスを無効化したようです。自分の.gitconfigを見てみると、確かにhttps://github.comの代わりに git://github.com を使うという設定がされています。

[url "git@github.com:"]pushInsteadOf = git://github.com/pushInsteadOf = https://github.com/[url "git://github.com/"]insteadOf = https://github.com/

GitHubによるとこれまでもgitプロトコルでのアクセスは読み取り専用だったようですが、ご丁寧にpushInsteadOfでgit@github.comを使用するという設定まで書かれているので、これまで問題無く使えてしまっていたようです。自分でもなぜこういう設定にしたのか記憶にないのですが、これは単にSSHプロトコルを使用すれば良いだけ、ということのようでしたので修正しました

[url "git@github.com:"]insteadOf = https://github.com/

GitHubの想定としてもどうせread-onlyだから使っている人なんてほとんどいないだろう、ということで引っかかる人も居ないでしょうが、メモとして残しておきます。