TortoiseGit更改默认端口22 [英] TortoiseGit change default port 22

查看:339
本文介绍了TortoiseGit更改默认端口22的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个简单的问题。
我在Windows 8上运行,并且想连接到我公司的存储库。我的公司将默认端口从22更改为1234,出于某种管理原因。



我的git存储库看起来像git@office.comp.com:proj.git。



首先,我不明白':proj.git'中的冒号符号,我习惯斜线符号。
其次,我想要一种方法来使用TortoiseGit或从命令行拉取和推入该端口。
我尝试更改网址,例如git@office.comp.com:1234:proj.git和git@office.comp.com:proj.git:1234,但没有希望。



我总是遇到连接超时错误。
我在命令行中使用了 ssh -vT -p 1234 git@office.comp.com 并且它能够连接。



现在我感到困惑,我可以使用ssh命令进行连接,但我不知道如何在TortoiseGit中使用它。

解决方案

对于不同的端口(和用户名),您可以使用以下URL风格 ssh:// USERNAME @ SERVER:PORT / PATH (例如, ssh://git@office.comp.com:1234 / proj.git )。






更精细的配置:

通过良好的会话管理,您可以在其中保存连接的属性(例如ssh密钥,用户名,端口)。



一个特殊的会话是默认设置会话,您可以为所有新连接设置默认值(例如,密钥,默认用户名,启用压缩,强制SSH版本2或更改默认端口等)。



您还可以将(单个)ssh连接的设置保存为会话。在一台服务器上,ssh服务器只在另一个端口上侦听,然后你可以设置所有设置并保存到例如服务器名称。现在,您可以通过启动PuTTY并双击保存的会话列表中的SERVERNAME来访问这些保存的设置,或者当使用TortoiseGit,plink或其他腻子应用程序时,输入的服务器名称(例如git @ SERVERNAME:/test.git)将匹配对照已保存的会话列表,如果找到,则使用已保存会话的设置。

会话名称不必是确切的服务器名称,也可以使用不同的名称,如果您想在一台服务器上使用具有相同用户名的不同密钥,请使用SERVERNAME1或SERVERNAME-adminkey(例如git @ SERVERNAME-adminkey:/test.git)。通过这种方式,也可以保存一个名为test.com的会话,但是当访问连接到example.com(保存的主机名)时会建立。



来源和更多信息: https://tortoisegit.org/docs/tortoisegit/tgit- ssh-howto.html (复制1:1,因为我是链接文本的作者)


It's probably an easy question. I'm running on windows 8, and I want to connect to my company's repository. My company changed the default port from 22 to 1234 for some administrative reason.

My git repository looks like git@office.comp.com:proj.git .

First of all I don't understand the colon-notation in ':proj.git', I'm used to the slash-notation. Secondly I want a way to pull and push on that port either using TortoiseGit or from the command line. I tried changing the url like git@office.comp.com:1234:proj.git and git@office.comp.com:proj.git:1234, but no hope.

I always get a connection timeout error. I used the ssh -vT -p 1234 git@office.comp.com in the command line and it was able to connect.

So now I'm confused, I was able to connect using the ssh command but I don't know how to use it inside TortoiseGit.

解决方案

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)

这篇关于TortoiseGit更改默认端口22的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆