gpt4 book ai didi

git - Gitlab CE git clone无法通过ssh运作

转载 作者:行者123 更新时间:2023-12-02 14:30:27 24 4
gpt4 key购买 nike

我已经在docker中安装了gitlab ce。
我想通过ssh从服务器制作git clone。
我在gitlab配置中设置了端口3000。
当我尝试制作git clone时,我接下来要做的是:
git clone ssh://git@git.site.com:3000/pm/site-crm.git
Cloning into 'site-crm'...
ssh: connect to host git.site.com port 3000: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我还要做什么?谢谢。

最佳答案

检查docker-gitlab issue 38中描述的SSH端口转发是否仍然有效:

Forward some other port on the host to port 22 of the container and use the GITLAB_SHELL_SSH_PORT configuration option to specify the forwarded port to the gitlab application so that the clone urls reflect this.

For example, add -p 3000:22 -e "GITLAB_SHELL_SSH_PORT=3000" to the docker run command.
Now you will notice that the ssh clone urls in the gitlab server will change to the form ssh://git@git.local.host:3000/docker/docker-gitlab.git.


这在 2017 blog post中仍然提到,它描述了另一种方法。

关于git - Gitlab CE git clone无法通过ssh运作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48675280/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com