1

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?

denis
  • 21,378
  • 10
  • 65
  • 88
pulamusic
  • 61
  • 1
  • 1
  • 7
  • 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 Oct 22 '18 at 15:48
  • 1
    Possible duplicate of [Git Could not expand include path '~/.gitcinclude', fatal: bad config file line 49 in /usr/local/git/etc/gitconfig](https://stackoverflow.com/questions/36908041/git-could-not-expand-include-path-gitcinclude-fatal-bad-config-file-line) – Mikkel Oct 22 '18 at 15:50
  • What versions of Xcode / of git do you have ? After upgrading to 10.14 Mojave, I downloaded Xcode 11.3.1 from https://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 Nov 22 '21 at 11:06

1 Answers1

1

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

pulamusic
  • 61
  • 1
  • 1
  • 7