I must have lost about six or seven hours trying to get a Rails application deploying from Git in the past week. I could push and pull from the repository, but could I get the thing to deploy via Capistrano? No, I could not.
The problem, as far as I could tell, was not with Capistrano. It was a simple SSH problem. I block port 22 for SSH on the server in question, for security reasons, and use a different port. But, no matter how I specified it, Git was insistent on trying to pull over 22. I did a lot of Googling, and found lots of conflicting answers, none of which worked.
And then I learned my lesson. That lesson is: when Linus tells you what to do, you do it:
Use the “
.ssh/config
” file ;)
So I configured a hostname in .ssh/config
on the server, and everything worked instantly.
A lot of problems tend to come down to SSH, it seems. After that point, everything went swimmingly.
Ivan Storck | 6 May 2009
Great! This finally solved the problem for me of git pulling from a non standard ssh port. Thank you!
exn | 17 Dec 2009
It was helpful so much because i’ve more than one repository on more than one none-standard port. Just a rest of the solution it’s using a different domain names for the server for each port. Thank you!
14 Sep 2009
Trackback: Using Git over non-standard SSH ports - Tim Akinbo’s Blog
29 Nov 2009
Trackback: Accessing git over ssh on a non-standard port » Hints and Kinks