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)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…