homebrewでcouldn't find remote ref refs/heads/master
% brew tap --repair fatal: couldn't find remote ref refs/heads/master Error: Failure while executing; `git -C /usr/local/Homebrew/Library/Taps/chef/homebrew fetch origin` exited with 128.
うーん、なんでじゃろ…と思ったんだけど。
https://github.com/chef/homebrew-chef
repositoryを見に行くと、
default branchの名前が、masterからmainに変わってるんですね。
面倒なので、該当repositoryを一旦削除してからcloneし直し。
% cd /usr/local/Homebrew/Library/Taps/chef/ % rm -rf homebrew-chef % git clone git@github.com:chef/homebrew-chef.git Cloning into 'homebrew-chef'... remote: Enumerating objects: 1401, done. remote: Counting objects: 100% (228/228), done. remote: Compressing objects: 100% (172/172), done. remote: Total 1401 (delta 165), reused 69 (delta 56), pack-reused 1173 Receiving objects: 100% (1401/1401), 267.00 KiB | 949.00 KiB/s, done. Resolving deltas: 100% (887/887), done.
そして再実行。
% brew tap --repair Updating Homebrew... %
問題なく終了しました。
default repository名がmasterからmainに変わっているrepositoryは結構あると思うので、 homebrewで何かしようとしたときに
fatal: couldn't find remote ref refs/heads/master
が出たときには、その確認した方が良いですね、というお話でした。