mac os 升级到 big sur 之后,输入 git 命令报错

在MacOS上遇到'git'未找到的问题,通过运行'xcode-select --install'安装更新,然后使用'sudo xcode-select -s /Library/Developer/CommandLineTools'设置路径,成功修复了git命令无法使用的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如题:

➜  ~ git --version
sh: line 1:  5402 Bus error: 10           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH

解决方法:

➜  ~ xcode-select --install

安装完后,再输入下面的命令

➜  ~ sudo xcode-select -s /Library/Developer/CommandLineTools

之后,再输入git 命令就好了:

➜  ~ git --version                                           
git version 2.24.3 (Apple Git-128)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值