gpt4 book ai didi

git - git 可以通过 ssh 端口转发工作吗?

转载 作者:行者123 更新时间:2023-12-02 15:01:08 25 4
gpt4 key购买 nike

我的情况是,我可以 ssh 到放置 git 存储库的 ComputerB (代码存储库)。但我本地的连接速度太慢,无法克隆代码。我可以 ssh 到另一台机器(ComputerA)速度更快,所以我想通过 ComputerA 克隆代码。

这就是我所做的:

           ssh tunnel                           ssh tunnel
MyComputer ----------> ComputerA (I can ssh to) ----------> ComputerB (where the Code repos is and I can ssh to but too slow)

使用这样的命令:

ssh -L1234:ComputerA_ip:22 Code_repos_ip

然后:

git clone git+ssh//localhost/repos local_repos (how can I assign the port 1234?)

如果这不起作用,我还能做什么?

最佳答案

通过两个连接如何使您的连接速度更快?

无论如何,你应该能够做到:

git clone git+ssh://localhost:1234/repos local_repos

关于git - git 可以通过 ssh 端口转发工作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/733057/

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