原因
ブランチ名が変更されており、update時にgithubで見つからなかったことが原因。
解決方法
ブランチ名が変わっている箇所を削除して、git cloneすることで解決。
流れ
下記のようにエラーになる、メッセージを読んでみるとブランチの名前が変わったか消されて見つけられないとのこと。brew tap –repairを実行してみるもエラー。
[xxxxx@xxxxxx] ~
% brew update
fatal: couldn't find remote ref refs/heads/master
Error: Fetching /usr/local/Homebrew/Library/Taps/rcmdnk/homebrew-file failed!
Error: Some taps failed to update!
The following taps can not read their remote branches:
rcmdnk/file
This is happening because the remote branch was renamed or deleted.
Reset taps to point to the correct remote branches by running `brew tap --repair`
[xxxxx@xxxxxx] ~
% brew tap --repair
fatal: couldn't find remote ref refs/heads/master
Error: Failure while executing; `git -C /usr/local/Homebrew/Library/Taps/rcmdnk/homebrew-file fetch origin` exited with 128.
githubを確認すると確かに、ブランチがmainに変わってる。
GitHub - rcmdnk/homebrew-file: Brewfile manager for Homebrew
Brewfile manager for Homebrew. Contribute to rcmdnk/homebrew-file development by creating an account on GitHub.
該当箇所を削除し、git cloneし直して解決した。
[xxxxx@xxxxxx] ~
% cd /usr/local/Homebrew/Library/Taps/rcmdnk/
[xxxxx@xxxxxx] /usr/local/Homebrew/Library/Taps/rcmdnk
% rm -rf homebrew-file (git)-[master]
[xxxxx@xxxxxx] /usr/local/Homebrew/Library/Taps/rcmdnk
% git clone https://github.com/rcmdnk/homebrew-file.git (git)-[master]
Cloning into 'homebrew-file'...
remote: Enumerating objects: 7488, done.
remote: Counting objects: 100% (560/560), done.
remote: Compressing objects: 100% (152/152), done.
remote: Total 7488 (delta 363), reused 482 (delta 317), pack-reused 6928
Receiving objects: 100% (7488/7488), 2.02 MiB | 8.39 MiB/s, done.
Resolving deltas: 100% (4087/4087), done.
[xxxxx@xxxxxx] /usr/local/Homebrew/Library/Taps/rcmdnk
% brew tap --repair (git)-[master]
[xxxxx@xxxxxx] /usr/local/Homebrew/Library/Taps/rcmdnk
% brew update (git)-[master]
Already up-to-date.
コメント