MacのOSをmacOS Mojaveにアップデートしたら、gitを使おうとするとエラーメッセージを表示するようになった。
$ git --version
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
このようなエラーメッセージが表示されたら、「code-select –install」を実行して、インストールすると良いらしい。
$ xcode-select --install
xcode-select: note: install requested for command line developer tools
インストールが完了したら、使えるようになった。
$ git --version
git version 2.17.1 (Apple Git-112)