mac解决brew install报错“fatal: not in a git directory“

macbook上使用brew安装软件时,可能会遇到问题,报错如下:

复制代码
fatal: not in a git directory
Error: Command failed with exit 128: git

使用brew -v,仔细看,可以发现有两个fatal(致命错误)提示:

解决方案:

直接复制brew -v 提示的命令 执行命令

复制代码
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

执行完成后brew -v无报错

再次使用brew install安装软件,完美解决

相关推荐
2401_833197732 小时前
为你的Python脚本添加图形界面(GUI)
jvm·数据库·python
待续3013 小时前
OpenClaw 安装及使用教程(Windows / macOS / Linux)
linux·windows·macos
敏编程3 小时前
一天一个Python库:tomlkit - 轻松解析和操作TOML配置
python
2401_879693873 小时前
使用Python进行图像识别:CNN卷积神经网络实战
jvm·数据库·python
yunyun321233 小时前
机器学习模型部署:将模型转化为Web API
jvm·数据库·python
团子和二花4 小时前
openclaw平替之nanobot源码解析(七):Gateway与多渠道集成
python·gateway·agent·智能体·openclaw·nanobot
未知鱼4 小时前
Python安全开发之简易目录扫描器(含详细注释)
开发语言·python·安全
Be1k04 小时前
推荐一款语雀知识库批量导出工具
python·gui·工具·语雀·批量导出·原创
Sunshine for you5 小时前
如何用FastAPI构建高性能的现代API
jvm·数据库·python
阿贵---5 小时前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python