Git no se pudo expandir include la ruta '~ / .gitcinclude', fatal: file de configuration incorrecta línea 49 en / usr / local / git / etc / gitconfig

Solía ​​tener una versión anterior de Git instalada en mi máquina OS X, pero luego actualicé el sistema a OS X 10.11 e instalé una versión más nueva de Git (2.6.4) y Git HTTP a través de Apache dejó de funcionar.

Tuve el siguiente error en el file apache_error.log :

 [Thu Apr 28 08:41:37 2016] [error] [client ::1] error: Could not expand include path '~/.gitcinclude' [Thu Apr 28 08:41:37 2016] [error] [client ::1] fatal: bad config file line 49 in /usr/local/git/etc/gitconfig 

Los contenidos del file gitconfig fueron:

 [core] excludesfile = ~/.gitignore legacyheaders = false # >git 1.5 quotepath = false # http://stackoverflow.com/questions/136178/git-diff-handling-long-lines pager = less -r # if ↑ doesn't work, try: pager = less -+$LESS -FRX [user] # name = your name # email = [email protected] [mergetool] keepBackup = true [push] default = simple # [ matching | simple ] [color] ui = auto interactive = auto [repack] usedeltabaseoffset = true # >git 1.5 [alias] s = status a = !git add . && git status au = !git add -u . && git status aa = !git add . && git add -u . && git status c = commit cm = commit -m ca = commit --amend # careful ac = !git add . && git commit acm = !git add . && git commit -m l = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset' ll = log --stat --abbrev-commit lg = log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative llg = log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit d = diff master = checkout master spull = svn rebase spush = svn dcommit alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort [include] # as of 1.7.10 https://github.com/git/git/commit/9b25a0b52e09400719366f0a33d0d0da98bbf7b0 path = ~/.gitcinclude path = .githubconfig path = .gitcnetworkingential #[github] # user = # token = [diff] # git does copy/rename *detection*. if you want it to track copies/renames: # http://stackoverflow.com/questions/1043388/record-file-copy-operation-with-git # renames = copies [diff "exif"] textconv = exif [cnetworkingential] helper = osxkeychain 

Busqué en Google, y lo que encontré fue la siguiente publicación https://software.intel.com/en-us/forums/intel-xdk/topic/600175/#node-600175 (en realidad, la marcada como BEST REPLY ) donde un usuario dice que debe hacerse lo siguiente dentro de ese file gitconfig :

 There's two things in the config file to edit.... Under the [core] heading : excludesfile = ~/.gitignore change to.... excludesfile = /Users/kevin/.gitignore and under [include] change : path = ~/.gitcinclude change to... path = /Users/kevin/.gitcinclude (change "kevin" to your user profile name ;) 

Cambié esas líneas dentro de mi gitconfig y las reemplacé ~/ con /Users/myuser/ :

 [core] excludesfile = /Users/myuser/.gitignore legacyheaders = false # >git 1.5 quotepath = false # http://stackoverflow.com/questions/136178/git-diff-handling-long-lines pager = less -r # if ↑ doesn't work, try: pager = less -+$LESS -FRX [user] # name = your name # email = [email protected] [mergetool] keepBackup = true [push] default = simple # [ matching | simple ] [color] ui = auto interactive = auto [repack] usedeltabaseoffset = true # >git 1.5 [alias] s = status a = !git add . && git status au = !git add -u . && git status aa = !git add . && git add -u . && git status c = commit cm = commit -m ca = commit --amend # careful ac = !git add . && git commit acm = !git add . && git commit -m l = log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset' ll = log --stat --abbrev-commit lg = log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative llg = log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit d = diff master = checkout master spull = svn rebase spush = svn dcommit alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort [include] # as of 1.7.10 https://github.com/git/git/commit/9b25a0b52e09400719366f0a33d0d0da98bbf7b0 path = /Users/myuser/.gitcinclude path = .githubconfig path = .gitcnetworkingential #[github] # user = # token = [diff] # git does copy/rename *detection*. if you want it to track copies/renames: # http://stackoverflow.com/questions/1043388/record-file-copy-operation-with-git # renames = copies [diff "exif"] textconv = exif [cnetworkingential] helper = osxkeychain 

Luego, Git a través de HTTP comenzó a funcionar. ¿Puede alguien decirme qué salió mal con mi installation de Git o tal vez es un error del lanzamiento de Git que he instalado?

Instalé Git en el sitio oficial https://git-scm.com/download/mac , como ya he dicho, versión 2.6.4.

Configuración HTTP de Apache / Git:

 # # Git over HTTP configuration # SetEnv GIT_PROJECT_ROOT /Users/git/GitRepositories # # Uncomment if you want Git to serve all repos, even those without git-daemon-export-ok inside of them. # SetEnv GIT_HTTP_EXPORT_ALL # # Tell Apache that anything coming into the /git path will be handled by git http-backend # ScriptAlias /git/ /usr/local/git/libexec/git-core/git-http-backend/ # # Tell Apache to allow requests to that path # <Directory "/usr/local/git/libexec/git-core*"> Options ExecCGI Indexes Order allow,deny Allow from all </Directory> # # Authenticated git push # <LocationMatch "^/git/.*/git-receive-pack$"> AuthType Basic AuthName "Git Access" AuthUserFile /Users/git/.htpasswd Require valid-user </LocationMatch> 

Todos los repos están dentro del directory /Users/git/GitRepositories del usuario git de mi sistema, que no es usuario myuser , pero no creo que ese sea el problema porque solía funcionar antes de actualizar Git.

Si alguien puede aclarar este comportamiento, le estaré agradecido.

Gracias por la atención.

Encontré este post de error al ejecutar git como un subprocess en un entorno restringido. La causa principal fue que la variable de entorno 'HOME' no estaba configurada para el subprocess; una vez que lo pasé, git estaba feliz.

Hice los siguientes cambios en el file gitconfig ubicado en /usr/local/git/etc/gitconfig

En el encabezado [core]:

 excludesfile = ~/.gitignore 

cambiar a….

 excludesfile = /Users/username/.gitignore 

y bajo [include] cambio:

 path = ~/.gitcinclude 

cambiar a…

 path = /Users/username/.gitcinclude 

Esto funcionó para mí. Ya no recibo el error.