In Git, how can I add a remote origin server when my host uses a different SSH port?
git remote add origin ssh://user@host/srv/git/example
In Git, how can I add a remote origin server when my host uses a different SSH port?
git remote add origin ssh://user@host/srv/git/example
You can just do this:
git remote add origin ssh://user@host:1234/srv/git/example
1234
is the ssh port being used
You need to edit your ~/.ssh/config file. Add something like the following:
Host example.com
Port 1234
A quick google search shows a few different resources that explain it in more detail than me.
Best answer doesn't work for me. I needed ssh://
from the beggining.
# does not work
git remote set-url origin user@example.com:10000/aaa/bbbb/ccc.git
# work
git remote set-url origin ssh://user@example.com:10000/aaa/bbbb/ccc.git
For those of you editing the ./.git/config
[remote "external"]
url = ssh://evanc@www.foo.com:11720/aaa/bbb/ccc
fetch = +refs/heads/*:refs/remotes/external/*