1

我的环境中的软件愿景

    git version 1.8.3.msysgit.0
    apache version httpd-2.2.25

我在 Repositories 文件夹中创建裸 git 存储库

我在我的 Windows 32 位机器上用 apache 配置 git,

我在 httpd.conf 文件中添加了以下代码

    after restarting apache
    in my browser it  display the all the repositories. it's works in browser.
    but I try to clone the git repo in my command client it prompt the error like


    Cloning into 'testrepo'...
    fatal: unable to access 'http://localhost/testrepo.git/': The requested URL returned
    error: 403


    SetEnv GIT_PROJECT_ROOT C:/Repositories
    SetEnv GIT_HTTP_EXPORT_ALL
    ScriptAliasMatch \
    "(?x)^/(.*/(HEAD | \
    info/refs | \
                    objects/(info/[Apache Git server on Windows^/]+ | \
                             [0-9a-f]{2}/[0-9a-f]{38} | \
                             pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                    git-(upload|receive)-pack))$" \
                    "C:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1"

    DocumentRoot "C:/Repositories"

    <Directory "C:/Repositories">
    Options Indexes FollowSymLinks Includes
    AllowOverride All
    Order deny,allow
    Allow from all
    </Directory>

提前致谢

4

1 回答 1

0
  1. 将 ScriptAliasMatch 改为一行:

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/Git/libexec/git-core/git-http-backend.exe/$1"

  1. 确保git-daemon-export-ok您的仓​​库中有空文件

这些都是帮助我的事情。我不确定的另一件事是<Directory ...>如果您之前申请DocumentRoot "C:/Repositories"过,请指定路径。

于 2013-08-20T13:10:53.343 回答