TortoiseGit change default port 22

非 Y 不嫁゛ 提交于 2019-11-28 01:23:10

For just a different port (and username) you can use the following URL style ssh://USERNAME@SERVER:PORT/PATH (e.g., ssh://git@office.comp.com:1234/proj.git).


For more fine grained configuration:

PuTTY comes with a great session management, where you can save attributes of connections (e.g. ssh key, username, port).

One special "session" is the Default Settings session, where you can set default values for all new connections (e.g. a key, a default username, enable compression, force SSH version 2 or change the default port and so on).

You can also save settings for (single) ssh connections as sessions. Take one server where the ssh server only listens on a different port, then you can set up all settings and save it to e.g. "SERVERNAME". Now you can access this saved settings by starting PuTTY and double clicking "SERVERNAME" in the saved sessions list OR, when using TortoiseGit, plink or other putty applications, the entered servername (e.g. git@SERVERNAME:/test.git) will be matched against the saved sessions list and if found, the settings of the saved session are used.

Session names do not need to be the exact servername, you can also use different names, like "SERVERNAME1" or "SERVERNAME-adminkey" (e.g. git@SERVERNAME-adminkey:/test.git) if you want to use different keys with the same username on one server. This way it is also possible to have a saved session called "test.com", but when accessed a connection to example.com (saved hostname) is established.

Source and further information: https://tortoisegit.org/docs/tortoisegit/tgit-ssh-howto.html (copied 1:1 because I'm the author of the linked text)

a simpler alternative is to use the following url format:

ssh://git@office.comp.com:1234/proj.git

you can use this format to clone directly from the repo without configuring the sessions in putty before.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!