在 cpanel 中使用 HTTP 克隆私有 git 存储库

时间:2020-12-21 10:55:30

标签: gitlab cpanel

我想将 Cpanel 与 GitLab 实例集成,它的存储库是私有的,我不能使用 SSH,因为我无权访问此实例的配置和 Cpanel 服务器(Cpanel 本身中的 ssh 密钥部分除外) ).

在 Cpanel 中,git 部分不接受私有 git 存储库的 HTTP URL,它建议改用 SSH URL,但我不能。

我尝试在 URL 中使用带有用户名和密码的 HTTP URL,但它阻止我这样做。像这样:
https://USER:PASS@gitlab-instance.com/username/repository.git

谁能帮我通过 SSH 访问私有 git 存储库?

1 个答案:

答案 0 :(得分:1)

你应该:

  1. 添加 ssh 密钥

https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html

  1. 通过 ssh 访问存储库

git@gitlab-instance.com:username/repository.git