【问题标题】:Error clone project gitlab with https使用 https 克隆项目 gitlab 时出错
【发布时间】:2013-02-12 10:44:34
【问题描述】:

当我尝试使用协议“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?

我尝试了很多解决方案,但错误仍然存​​在。

有人可以帮助我吗?

感谢您的帮助,祝您有美好的一天!

【问题讨论】:

  • 你运行的是哪个 GitLab 版本?
  • 这里有同样的问题。我在全新安装的 4.2 和升级安装的 4.2 上都有这个。
  • 你要克隆一个新项目吗?

标签: git https gitlab


【解决方案1】:

我的问题是 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

【讨论】:

    【解决方案2】:

    此错误的常见来源是 URL 中的某种错误。确保你做对了。你可以通过 HTTP 克隆吗?您的服务器是否设置为通过 HTTP 和 HTTPS 为存储库提供服务?

    如果你的 git 客户端(读取 git --version 的输出),它将无法使用智能 HTTP 后端。

    GitLab issue #1924 中的评论建议排除服务器端的权限问题。

    【讨论】:

    • 不正确的 URL,但我也不能通过 HTTP 克隆。我检查了你给我的链接,但没有解决我的问题。
    • git 版本是 1.8.1.msysgit.1。
    【解决方案3】:

    当您在 .../gitlab/config/gitlab.yml 配置文件中更改了 gitlab 应用程序的 relative_url_root 变量的默认配置时,可能会发生此错误。默认值为/。当您将默认值更改为时,例如/gitlab,网址为

        http://your.domain/gitlab
    

    这在 UI 中正确显示为项目的克隆 url,例如

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

    但不知何故,在通过 http 或 https 进行实际克隆时未检查此配置。

    在 github 上的 gitlab 问题列表中已经有一个 discussion and a bugfix 关于它。这里是the rawfile

    我的配置是gitlab v5.0和gitlab-shell v1.1.0。

    【讨论】:

      猜你喜欢
      • 2020-03-23
      • 2016-10-27
      • 2013-11-27
      • 2016-08-25
      • 2016-08-08
      • 1970-01-01
      • 2022-01-14
      • 2021-09-09
      • 2019-01-09
      相关资源
      最近更新 更多