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?
- Git does not recognize repositories while executing a hook
- I cannot clone repository although I have access to it
- How to determine SSH fingerprint of client for usage in Git hook
- Best practice for multiple vagrant boxes
- Why do git commands executed remotely affect the originating server?
- Cannot 'git push' to Heroku
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..