1
votes

I recently upgraded my MacOS to Mojave, and now I have found that Git doesn't work. I continue to get the following error message when I try to initialize a new git repo on my machine:

error: could not expand include path '~/.gitcinclude'
fatal: bad config line 44 in file /usr/local/git/etc/gitconfig

Here are lines 43-46 of the gitconfig file on my machine:

[include]
    path = ~/.gitcinclude
    path = .githubconfig
    path = .gitcredential

I followed the advice from another stackOverflow question (Git is not working after macOS Mojave Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)), but Git still refuses to work. Specifically, I ran the following to upgrade xcode:

xcode-select --install

I then re-set the path to the xcode folder:

sudo xcode-select -switch /Library/Developer/CommandLineTools

Any suggestions as to where I should go from here?

1
What is on line 44 of /usr/local/git/etc/gitconfig? Is the HOME environment variable set in the process that is running git? - quasar
What versions of Xcode / of git do you have ? After upgrading to 10.14 Mojave, I downloaded Xcode 11.3.1 from developer.apple.com/downloads (7 GB), then Command Line Tools for Xcode 11.3.1.dmg installed /usr/bin/git -> git version 2.21.1 (Apple Git-122.3) - denis

1 Answers

1
votes

I got it. The second answer from another stackOverflow question did the trick. I missed it in my previous search because this question doesn't specifically address MacOS problems.

Git Could not expand include path '~/.gitcinclude', fatal: bad config file line 49 in /usr/local/git/etc/gitconfig