gpt4 book ai didi

Git 无法扩展包含路径 '~/.gitcinclude',致命 : bad config file line 49 in/usr/local/git/etc/gitconfig

转载 作者:太空狗 更新时间:2023-10-29 14:25:32 26 4
gpt4 key购买 nike

我以前在我的 OS X 机器上安装了旧版本的 Git,但后来我将系统升级到 OS X 10.11 并安装了更新版本的 Git (2.6.4),通过 Apache 的 Git HTTP 停止工作。

我在 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

gitconfig 文件的内容是:

[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 = your@name

[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 = .gitcredential

#[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
[credential]
helper = osxkeychain

我在谷歌上搜索了很多,找到的是以下帖子 https://software.intel.com/en-us/forums/intel-xdk/topic/600175/#node-600175 (实际上是标记为 BEST REPLY 的那个)用户说必须在 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 ;)

我在 gitconfig 中更改了这些行,并将 ~/ 替换为 /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 = your@name

[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 = .gitcredential

#[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
[credential]
helper = osxkeychain

然后 Git over HTTP 开始工作。谁能告诉我我的 Git 安装出了什么问题,或者这可能是我安装的 Git 版本的错误?

我已经从官方网站安装了 Git https://git-scm.com/download/mac ,如我所说,版本 2.6.4。

Apache/Git HTTP 配置:

#
# 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>

所有存储库都在目录 /Users/git/GitRepositories 中
我系统的 git 用户,它不是 myuser 用户,但我不认为这是问题所在,因为它在我更新之前曾经工作过混帐。

如果有人能澄清这种行为,我将不胜感激。

感谢关注。

最佳答案

我在位于 /usr/local/git/etc/gitconfig 的 gitconfig 文件中做了以下更改

在[核心]标题下:

excludesfile = ~/.gitignore     

改为....

excludesfile = /Users/username/.gitignore

在 [include] 下更改:

path = ~/.gitcinclude

更改为...

path = /Users/username/.gitcinclude

这对我有用。我不再收到错误。

关于Git 无法扩展包含路径 '~/.gitcinclude',致命 : bad config file line 49 in/usr/local/git/etc/gitconfig,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36908041/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com