【发布时间】:2019-03-26 18:01:34
【问题描述】:
我最近将我的 MacOS 升级到 Mojave,现在我发现 Git 不起作用。当我尝试在我的机器上初始化一个新的 git repo 时,我继续收到以下错误消息:
error: could not expand include path '~/.gitcinclude'
fatal: bad config line 44 in file /usr/local/git/etc/gitconfig
这是我机器上 gitconfig 文件的第 43-46 行:
[include]
path = ~/.gitcinclude
path = .githubconfig
path = .gitcredential
我遵循了另一个 stackOverflow 问题 (Git is not working after macOS Mojave Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)) 的建议,但 Git 仍然拒绝工作。具体来说,我运行以下代码来升级 xcode:
xcode-select --install
然后我重新设置 xcode 文件夹的路径:
sudo xcode-select -switch /Library/Developer/CommandLineTools
关于我应该从这里去哪里有什么建议吗?
【问题讨论】:
-
/usr/local/git/etc/gitconfig 的第 44 行是什么?运行git的进程中是否设置了HOME环境变量?
-
你有哪些版本的 Xcode / git?升级到 10.14 Mojave 后,我从 developer.apple.com/downloads (7 GB) 下载了 Xcode 11.3.1,然后安装了
Command Line Tools for Xcode 11.3.1.dmg/usr/bin/git->git version 2.21.1 (Apple Git-122.3)