brewコマンド実行時にGitHub周りでエラーが発生したので対処した話。
エラー内容
$ brew search tree ✘ 1
==> Searching local taps...
mvptree pstree tree ✔ treecc treefrog
==> Searching taps on GitHub...
Error: GitHub
The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
Or create a personal access token:
https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
and then set the token as: export HOMEBREW_GITHUB_API_TOKEN="your_new_token"
対応
「キーチェーンアクセス」アプリから「github.com」のエントリを削除。
コメントでご指摘頂きまして、アプリから手動削除するより以下のコマンドを実行しましょう。
$ printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase