我需要在 Windows 服务器上设置 Git 存储库。要求是:
我已经完成了标准的 Git 安装并将这些行添加到 Apache 的httpd.conf文件中:
SetEnv GIT_PROJECT_ROOT "D:/srv/git"
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ "C:/Program Files/Git/mingw64/libexec/git-core/git-http-backend/"
<Location "/git/testproject.git">
AuthType Basic
require group developers
AuthName "Git test project"
AuthUserFile D:/srv/gitauth/auth.txt
AuthGroupFile D:/srv/gitauth/groups.txt
</Location>
Run Code Online (Sandbox Code Playgroud)
"C:/Program Files/Git/mingw64/libexec/git-core/git-http-backend/"是我git-http-backend在 Windows 上找到可执行文件的地方。auth.txt是一个文件,htpasswd其中包含我的用户的用户名/密码,并groups.txt包含一行定义我的用户在名为developers.
为了测试,我在D:/srv/git/testproject.git.
在我的客户端计算机上,我尝试克隆此存储库并收到此错误:
git clone https://[serverurl]/git/testproject.git
Cloning into 'testproject'...
fatal: unable to …Run Code Online (Sandbox Code Playgroud)