首页 > 其他分享 >mac git clone error:xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools)

mac git clone error:xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools)

时间:2023-07-14 14:13:06浏览次数:31  
标签:git clone Library xcrun error xcode select Developer

背景
升级Mac系统后,在终端使用git clone等相关命令失败,报错

xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools),missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun

1.问题排查

1.查看git是否已经安装

# 命令
which git

# 结果
/usr/local/bin/git

说明git已经安装

2.查看git帮助信息
git --help
1
报错同上:

xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools),missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun
1
综上git已经安装但是git命令不能正常使用,可能是git安装包被损坏了,于是重新安装一下git

3.重新安装git
brew install git
1
安装过程中出现如下错误信息:

Error: The following formula:
git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
xcode-select --install

Error: Git must be installed and in your PATH!
Error: The following formula:
git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
xcode-select --install

根据提示信息可知需要重新安装一下xcode-select;

解法:安装xcode-select
综上分析需要重新安装xcode-select,在终端执行如下命令

xcode-select --install
1
安装完成后在执行一下:

git --help


可以正确输出信息说明git已经恢复正常,可以使用了

 

标签:git,clone,Library,xcrun,error,xcode,select,Developer
From: https://www.cnblogs.com/douyage/p/17553515.html

相关文章

  • fastapi框架docs文档Responses去掉默认的异常响应422Validation Error
    fastapi框架原生docs的Responses中会有个默认的422ValidationError响应,但大多数实际开发应该不需要,如何去除呢?我用的方法是用猴子补丁重写fastapi.openapi.util里的get_openapi_path方法,去掉加入默认422的那段代码即可,下面这些http422=str(HTTP_422_UNPROCESSABLE_ENTITY)......
  • python ModuleNotFoundError: No module named 'flask'
    问题:pip安装了模块,提示Nomodulenamed解决方法:1.先看看模块列表里是否安装好了:piplist模块名2.看看模块安装路径:pipshow模块名3.多个版本的Python,看看pip把包安装到哪个版本的lib/python3.8/site-packages路径下1)先确认命令指向的版本:一般是在/usr/bin/下......
  • 【报错解决】使用代理后从Github中clone仓库报错
    当电脑使用代理后,会造成Github的clone和push等功能无法正常使用报错内容:PSD:\Github>gitclonehttps://github.com/sige5193/bittly.gitCloninginto'bittly'...fatal:unabletoaccess'https://github.com/sige5193/bittly.git/':Failedtoconnecttogithub.com......
  • java代码修改git提示
    实现Java代码修改Git提示概述在进行Java代码开发时,使用Git进行版本控制是非常常见的做法。在开发过程中,我们经常需要对代码进行修改,而每次修改代码后,我们都需要提交这些修改到Git仓库,并且最好附带一些有意义的提交信息,以便后续的代码审查和追踪。为了方便开发者在进行代码修改时......
  • Svn版本控制该Git
    .idea下的vcs.xml文件vcs的值为svn或Git......
  • .NET 7发布到IIS HTTP 错误 500.19 - Internal Server Error
    之前一直都是用的独立发布,就没有配置过服务器环境,今天发布了一个依赖版,果不其然报错了一番查找之后原因也是很简单,服务器需要安装一个.NET运行时的环境https://dotnet.microsoft.com/zh-cn/download/dotnet/7.0打开之后下载这一个,你也可以选择下载左边的SDK,里面是包含了.NET运......
  • antd from 表单中的key 不能绑定input中的字段 Input.js:207 Uncaught (in promise)
    <Formclass="NewVersion"ref="formRef"name="NewVersion":model="formData"><Spacev-for="(newPg,index)informData.version":key="index"style="dis......
  • rclone 的下载地址-官方网站
    DownloadsRcloneissingleexecutable(rclone,or rclone.exe onWindows)thatyoucansimplydownloadasaziparchiveandextractintoalocationofyourchoosing.Seethe install documentationformoredetails.Releasev1.63.0Arch-OSWindowsmacOSLinux......
  • 5、git强制更新本地代码
    git强制更新本地代码(和远端代码保持一致)目录git强制更新本地代码(和远端代码保持一致)1.拉起最新远端代码版本2.同步本地到最新版本3.拉取代码4.简化写法备注1.拉起最新远端代码版本撤销本地、暂存区、版本库、gitfetch--all2.同步本地到最新版本回退到最新的远端代......
  • startapp时出现 CommandError错误
    startapp时出现CommandError:'xxxxx'conflictswiththenameofanexistingPythonmoduleandcannotbeusedasanappname.Pleasetryanothername.错误原因可能是在settings.py中加入了sys.path.append(os.path.join(BASE_DIR,'app'))解决办法,先将上面这行代码......