繁体   English   中英

无法使用 SSH 克隆 GIT 存储库

[英]Cannot clone GIT repository using SSH

在 Windows 中

克隆 GIT 存储库时,我可以成功地做到这一点:

git clone https://user@gitlab.example.com/clientes/sample/project.git

但是,当我这样做时:

git clone ssh://user@gitlab.example.com:17177/clientes/sample/project.git

显示登录横幅后,显示此错误:

fatal: '/clientes/sample/project.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

在 MacOS 中

使用 HTTPS 方式时,会显示 SSL 证书过期错误。

使用 SSH 方式时,和 Window 一样的错误。

我该如何解决这些问题?

问题是我正在使用我的 Git 用户。 Git 是使用 git user 安装的,所以我更改为 git user 并且存储库错误消失了

任何 GitLab 实例(本地或 SaaS gitlab.com )都不允许用户 SSH 访问。
它只允许一个帐户,即“ git ”服务帐户。

然后通过用于建立该连接的公共 SSH 密钥执行用户身份验证,因为所述公共密钥已注册到您的 GitLab 帐户。

任何一个

  1. 您需要整理对存储库设置的访问权限。

  2. 在存储库上创建许可证、条款和证书文件。 从外观上看,它无法验证证书。 当你创建一个存储库时,git 应该很容易自动创建一个。 或者自己创建一个。

暂无
暂无

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

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