通过git+ssh协议连接git时端口号是否相同?

Tom*_*mek 1 ssh port port-forwarding git protocol

我想知道在连接到 git 存储库时,git+ssh 协议是否使用与仅使用 git 协议相同的端口号。例如:

git://example.com/git/helloworld

git+ssh://root@example.com/git/helloworld

我正在尝试使用 EGit 推送到仅在 git 协议端口号 (9418) 上设置了端口转发的远程存储库。当我尝试使用 git+ssh 时,EGit 告诉我

git+ssh://.... connection is closed by foreign host
Run Code Online (Sandbox Code Playgroud)

谢谢,

托梅克

Ign*_*ams 6

git+ssh 是 ssh 客户端上的 git。因此,它使用 SSH 端口 (22) 而不是 git 端口。