【软件安装】mac 使用 git报错

更新mac 系统后,git 突然报错不能用了,相关错误大致如下:

git: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find git 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)

问题原因:使用git的时候需要CommandLineTools

解决方案:

  1. 下载对应的 CommandLineTools,下载地址:https://developer.apple.com/download/all/
  2. 下载后按步骤安装
  3. 终端内执行命令:sudo xcode-select --switch /Library/Developer/CommandLineTools/

更新系统后如果使用 git 后出现如下错误:
在这里插入图片描述
则按照如下方法进行:

  1. xcode-select -p
  2. sudo xcode-select -r
  3. xcode-select -p

然后就可以正常使用。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值