当我试图用协议"Https"克隆我的Gitlab项目时,遇到了一个问题。有了git协议,一切都很好。
错误:
Cloning into 'test'...
fatal: https://XXXX.XXXX.XXXX.XXXX/user.name/test.git/info/refs?service=git-upload-pack
not found: did you run git update-server-info on the server?
我尝试了很多解决方案,但错误仍然存在。
有人能帮我吗?
谢谢你的帮助,祝你今天愉快!
我的问题是Apache配置文件。我的示例配置
<VirtualHost ip:80>
ServerName git.domain.tld
Redirect permanent / https://git.domain.tld/
</VirtualHost>
<VirtualHost ip:443>
ServerName git.domain.tld
DocumentRoot /home/git/gitlab/public
<Location />
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://git.domain.tld
</Location>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
RequestHeader set X_FORWARDED_PROTO 'https'
</VirtualHost>
来源:https://github.com/gitlabhq/gitlab-recipes/tree/master/web-server/apache
此错误的常见来源是URL中的某种错误。确保你说得对。你能通过HTTP进行克隆吗?您的服务器是否设置为通过HTTP和HTTPS为存储库提供服务?
如果您的git客户端(读取git --version
的输出),它将无法使用智能HTTP后端。
GitLab第1924期的一条评论建议排除服务器端的权限问题。
当您在.../gitlab/config/gitlab.yml
配置文件中更改gitlab应用程序的relative_url_root
变量的默认配置时,可能会发生此错误。默认值为/
。当您将默认值更改为,例如/gitlab
时,url将为
http://your.domain/gitlab
这在UI中正确显示为项目的克隆url,例如
http://your.domain/gitlab/group/project.git
但不知何故,在通过http或https进行实际克隆时,没有检查此配置。
github上的gitlab问题列表中已经对此进行了讨论和错误修复。这是原始文件。
我的配置是gitlab v5.0和gitlab shell v1.0。