【笔记】删除Xcode后给Mac装Git...

如果不喜欢用 Xcode 或者因为存储不够用,比如我习惯了VS Code(其实我就是因为想省存储),删除Xcode之后的Git无法使用,回出现以下报错。

xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --ins
tall` to install the standalone command line developer tools.
See `man xcode-select` for more details.

可以看到这里面apple有叫你做几个事情,但是...最好别了哈哈哈哈哈哈

=====================================言归正传分割线==========================================

首先,到 Git官网 下载,下载完成,安装成功之后。到以下目录查看 git 是不是在那里

cd /usr/local/bin

如果 git 在,则顺序执行:

echo "PATH=/usr/local/git/bin:\$PATH" >> ~/.bash_profile

source ~/.bash_profile

最后关掉 terminal,重新打开就可以愉快地用 Xcode 以外的 IDE 了。

这种方法对于我这种买了 256GB 存储 mac 的穷人来说实在是太友好了...啊哈哈哈哈哈哈哈哈哈哈哈

祝你们用得愉快~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章