开发者

Setting remote to use specified port for ssh

I have ssh keys setup to work on a specified port (e.g. 12345) and issued the following git command to set the origin on a local repo.

git remote add origin myusername@mydomain.com:12345/path/to/public_html/files/

I am getting the following error message when i try to push to origin.

ssh: connect to host mydomain.com port 22: Connection refused
fatal: The remote end hung up u开发者_如何学JAVAnexpectedly

How do i set origin so it is using the proper port for ssh?


To specify a custom port, you have to add the ssh:// prefix. Otherwise, git interprets your 12345 as part of the project's path. See URLs in the git-pull docs. So:

git remote add origin ssh://myusername@mydomain.com:12345/path/to/public_html/files/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜