macOSをアップデートしたらgitコマンドが使えなくなった時の対処
背景
タイトルの通り。 脆弱性やばそうなのでアップデートしたが、gitコマンドが動かなくなった。
エラー内容
$ git status xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
原因
大型アップデートに伴うCommandLineToolsの欠落。 今回に限らず、macOSあるあるらしい。
解決方法
xcodeをインストールし直す。
1. ターミナル上でxcode-selectをインストール
$ xcode-select --install xcode-select: note: install requested for command line developer tools
※ インストールしますか?的な画面が出てくるのでOKする
2. 確認
$ git status On branch develop Your branch is up to date with 'origin/develop'. nothing to commit, working tree clean
解決