【问题标题】:Setting openssh port in windows for msysgit在 windows 中为 msysgit 设置 openssh 端口
【发布时间】:2011-01-03 01:01:19
【问题描述】:

一个简单的问题。我正在使用带有 openSSH 的 msysgit 作为 git 客户端。我不想使用其他 ssh 客户端,例如 putty。从 GIT Bash 我已经成功地使用 ssh -p XXXX 连接到我的服务器到我的服务器。

不幸的是,当我尝试做类似的事情时:

git clone git@SERVER:reponame.git 

我从 Git Bash 中得到:

ssh: connect to host SERVER port 22 failed.

如何使 msysgit 尝试使用 openssh 打开的 ssh 连接在不同的端口上运行?

我知道在 linux 中这样的东西会在 /etc/ssh/ssh_config 文件中,但在这种情况下我将如何去做呢?提前致谢。

【问题讨论】:

    标签: windows git msysgit


    【解决方案1】:

    git 支持ssh:// 的以下语法

    ssh://[user@]host.xz[:port]/path/to/repo.git/
    

    注意那里的端口。

    【讨论】:

    • 感谢您的快速回复亚历克斯。如果我尝试: git clone user@host:port/pathtorepo.git 我仍然会收到端口 22 错误。我正在研究 Git Bash
    • @lefteris,试试git clone ssh://user@host:port/pathtorepo.git
    • 谢谢亚历克斯!那行得通!!!!它也可以通过 tortoise-git 工作。终于设置好git了。一个大拇指的人:)
    猜你喜欢
    • 2014-01-19
    • 2019-03-23
    • 2021-05-01
    • 2011-02-12
    • 2013-04-19
    • 1970-01-01
    • 2011-06-11
    • 2018-11-06
    • 1970-01-01
    相关资源
    最近更新 更多