Windows中的git 403错误

时间:2013-07-24 11:15:48

标签: git apache http

我环境中的软件愿景

    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>

提前致谢

1 个答案:

答案 0 :(得分:0)

  1. 将ScriptAliasMatch更改为一行:
  2. 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个空文件
    2. 这些是帮助我的事情。另一件事,我不确定如果您之前已应用<Directory ...>,则在DocumentRoot "C:/Repositories"中指定路径。