git remote add with other SSH port

JuanPablo picture JuanPablo · Aug 29, 2010 · Viewed 310.2k times · Source

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

Answer

igorw picture igorw · Aug 29, 2010

You can just do this:

git remote add origin ssh://user@host:1234/srv/git/example

1234 is the ssh port being used