git remote add with other SSH port
In Git, how can I add a remote origin server when my host uses a different SSH port?
5 Solutions collect form web for “git remote add with other SSH port”
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.
For those of you editing the
[remote "external"] url = ssh://firstname.lastname@example.org:11720/aaa/bbb/ccc fetch = +refs/heads/*:refs/remotes/external/*
Best answer doesn’t work for me. I needed
ssh:// from the beggining.
# does not work git remote set-url origin email@example.com:10000/aaa/bbbb/ccc.git # work git remote set-url origin ssh://firstname.lastname@example.org:10000/aaa/bbbb/ccc.git
Found this link, and although it was helpful my blog entry might help clarify it:
Basically i think its much better to just edit your .git/config file and make the changes. Hopefully this will help someone else..