macOS seria 10.12升级到macOS Mojave的报错:xcrun: error: invalid active developer path, missing xcrun

今天升级mac系统到macOS mojave后,在终端操作gitlab时遇到一行莫名其妙的错误:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

  通过google,查找到以下解决方法:

xcode-select --install

  然后重新打开终端就可以了

原文地址:https://www.cnblogs.com/winnerREN/p/9849738.html