我正在使用Apache和git-http-backend.exe在WS 2008机器上设置Git服务器(1.7.2.3).我一直在关注一个良好的啧啧这里.我有GUI工作,我可以惹恼克隆,如果我把以下内容放在回购配置中我可以惹恼:
[http]
receivepack = true
Run Code Online (Sandbox Code Playgroud)
我已将以下内容添加到httpd.conf文件中:
SetEnv GIT_PROJECT_ROOT C:/GIT/Repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
"C:/Program Files (x86)/git/libexec/git-core/git-http-backend.exe/$1"
<Directory />
Allow from all
</Directory>
<LocationMatch "^/git/.*/git-receive-pack$">
AuthType Basic
AuthName "Git Access"
AuthUserFile C:/GIT/ApacheConfig/users
AuthGroupFile C:/GIT/ApacheConfig/groups
Require group repogeneral
</LocationMatch>
Run Code Online (Sandbox Code Playgroud)
当我添加"LocationMatch"时,我仍然可以克隆,或者通过在URL中指定一个名称,git clone http://jon@myserver.com
它会提示输入密码并进行克隆.
但当我试图回到回购时,我得到以下内容:
错误:无法访问URL http://jon@myserver.com/newtestrepo.git/,返回代码22致命:git-http-push failed
我一直在查看http-backend.exe手册页中的示例,但无法让它们工作.
这是我的群组文件,(这只是测试示例,所以没有任何可用于prod):
admin: jon steve admin
webview: jon steve web
repogeneral: jon …Run Code Online (Sandbox Code Playgroud) 我正在设置一个git-http-backend CGI脚本来处理我的git.domain子域.服务器位于AWS云上的ELB(弹性负载平衡器)后面.我的服务器配置如下(我的git托管由gitolite处理):
<VirtualHost *:80>
ServerName git.domain
ServerAdmin hjpotter92+git@domain
#SuexecUserGroup git git
DocumentRoot /opt/gitolite/repositories/
PerlLoadModule Apache::Authn::Redmine
SetEnv GIT_PROJECT_ROOT /opt/gitolite/repositories/
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER # Have also tried removing this variable
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$" \
/opt/gitolite/git-core/git-http-backend/$1
<Directory "/opt/gitolite/git-core">
AllowOverride None
Options +ExecCGI -Includes
Require all granted
</Directory>
<Location />
# enabled in desparation...
# saw it somewhere in bugzilla powered mailing list
DAV On
Order …Run Code Online (Sandbox Code Playgroud) 我在我的服务器上使用git init --bare. 我在那里添加了一些文件,然后从 myserver 克隆了我的存储库git clone http://www.example.com/mygit/repo,它完美地克隆了。现在我想推送这个目录,git push origin master但它返回代码 22。我还添加了我的 PC 的 ssh 公钥http://www.example.com/mygit/repo/.ssh/authorized_keys,但我仍然无法推送到我的存储库。