相关疑难解决方法(0)

在Windows上使用git-http-backend.exe设置Git服务器

我正在使用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 apache2 git-http-backend

22
推荐指数
1
解决办法
3万
查看次数

如何在http上设置git?

我需要使用git-over-http(智能http)设置一个git服务器,但是在线可用的资源很混乱,混合了其他apache配置,缺少细节或者不够明确.

我是根据我发现缺乏可用资源的问题自己回答这个问题的.

apache git http git-http-backend

18
推荐指数
1
解决办法
3万
查看次数

GIT-HTTP的后端

我尝试使用git-http-backend设置一个git服务器,一切都按照我的要求运行,但有一点小事.

配置

<VirtualHost *:80>
ServerName git.server.com
SetEnv GIT_PROJECT_ROOT /srv/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias /git /usr/lib/git-core/git-http-backend/

<Directory "/usr/lib/git-core*">
   Options ExecCGI Indexes
   Order allow,deny
   Allow from all
</Directory>

<LocationMatch "^/git/repos/git-receive-pack$">
  AuthType Digest
  AuthName "Git Repositories"
  AuthUserFile /srv/git/.git-auth-file
  AuthGroupFile /srv/git/.git-group-file
  Require valid-user
</LocationMatch>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

这允许每个人阅读repos但只有有效的用户才能阅读.让我烦恼的是网址是http://git.server.com/git/repos.我想摆脱URL 中的git,如http://git.server.com/repos.当我将配置更改为

<VirtualHost *:80>
ServerName git.server.com
SetEnv GIT_PROJECT_ROOT /srv/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias / /usr/lib/git-core/git-http-backend/

<Directory "/usr/lib/git-core*">
   Options ExecCGI Indexes
   Order allow,deny
   Allow from all
</Directory>

<LocationMatch "^/repos/git-receive-pack$">
  AuthType Digest
  AuthName …
Run Code Online (Sandbox Code Playgroud)

apache git git-http-backend

15
推荐指数
2
解决办法
2万
查看次数

Apache和git-http-backend

我目前正在使用Apache 2.4.7在Ubuntu LTS 14.04机器上设置一些git存储库.

这是apache配置:

SetEnv GIT_PROJECT_ROOT /var/www/html/git
SetEnv GIT_HTTP_EXPORT_ALL 1
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
ScriptAliasMatch \
    "(?x)^/git/(.*/(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))$" \                                                                                                      
    /usr/lib/git-core/git-http-backend                                                                                                                   

<Location /git/oswald.git>
 Options +ExecCGI
 AuthType Basic
 DAV on
 AuthName "Git"
 AuthUserFile /etc/apache2/git_paragon_passwd
 Require valid-user

    Order allow,deny
    Allow from all
</Location>
Run Code Online (Sandbox Code Playgroud)

测试存储库在/var/www/html/git/oswald.git.在存储库中,我设置了config属性

http.receivepack=true
Run Code Online (Sandbox Code Playgroud)

该文件git-daemon-export-ok存在.

如果我现在尝试克隆:

git clone https://server/git/oswald.git
Run Code Online (Sandbox Code Playgroud)

认证后,我得到:

fatal: https://server/git/oswald.git/info/refs not valid: is this a git repository?
Run Code Online (Sandbox Code Playgroud)

(git 2.1.0客户端,在服务器git 1.9.1上).

我尝试了几件事,所以如果我不使用git-http-backend并通过WebDAV我可以克隆但不能推送,使用git-http-backend我甚至无法克隆.

如果我改变的最后一行 …

apache git git-http-backend

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

git ×4

git-http-backend ×4

apache ×3

apache2 ×1

http ×1