简体   繁体   English

错误克隆项目gitlab与https

[英]Error clone project gitlab with https

I've a problem when i try to clone my Gitlab project with the protocol "Https". 当我尝试使用协议“Https”克隆我的Gitlab项目时,我遇到了问题。 With the git protocol everything works fine. 使用git协议一切正常。

The error: 错误:

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?

I've tried many solutions but the error is still here. 我尝试了很多解决方案,但错误仍然存​​在。

Somebody can help me? 有人可以帮帮我吗?

Thank's for your help and have a nice day! 感谢您的帮助,祝您度过愉快的一天!

My Problem was the Apache configuration file. 我的问题是Apache配置文件。 My example configuration 我的示例配置

<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>

Source: https://github.com/gitlabhq/gitlab-recipes/tree/master/web-server/apache 资料来源: https//github.com/gitlabhq/gitlab-recipes/tree/master/web-server/apache

A common source of this error is some sort of mistake in the URL. 此错误的常见来源是URL中的某种错误。 Be sure you have it right. 确保你做对了。 Can you clone over HTTP? 你能通过HTTP克隆吗? Is your server set up to serve the repository over both HTTP and HTTPS? 您的服务器是否设置为通过HTTP和HTTPS提供存储库?

If your git client (read the output of git --version ), it won't be able to use the smart HTTP back end. 如果你的git客户端(读取git --version的输出),它将无法使用智能HTTP后端。

A comment in GitLab issue #1924 suggests ruling out permission issues on the server side. GitLab问题#1924中的评论建议排除服务器端的权限问题。

This error can occur when you've changed the default configuration for the relative_url_root variable for the gitlab application in your .../gitlab/config/gitlab.yml config file. 当您在.../gitlab/config/gitlab.yml配置文件中更改gitlab应用程序的relative_url_root变量的默认配置时,可能会发生此错误。 The default value is / . 默认值为/ When you change the default value to, eg /gitlab , the url will be 当你将默认值更改为例如/gitlab ,url将是

    http://your.domain/gitlab

This is showed as the cloning url for a project in the UI correctly, eg 这被正确显示为UI中项目的克隆URL,例如

    http://your.domain/gitlab/group/project.git

but somehow this configuration is not checked, while doing the actual clone over http or https. 但不知何故,在通过http或https进行实际克隆时,不会检查此配置。

There has already been a discussion and a bugfix about it in the gitlab issue list on github. 在github上的gitlab问题列表中已经有关于它的讨论和错误修正 Here is the rawfile . 这是rawfile

My configuration is gitlab v5.0 and gitlab-shell v1.1.0. 我的配置是gitlab v5.0和gitlab-shell v1.1.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM