tags:

views:

235

answers:

3

Hi,

I am setting up my local git project for a remote repository. The remote repository got a non-standard port(4019).

But it doesn't work, I get the following error message:

ssh: connect to host git.host.de:4019 port 22: Connection refused
fatal: The remote end hung up unexpectedly
error: failed to push to 'ssh://[email protected]:4019/var/cache/git/project.git'

My local git config is: http://pastie.org/652605

Port and Host are dummy values;-)

Does anybody know what is wrong with my git configuration?

Best regards and thanks!

+5  A: 

If you put something like this in your .ssh/config:

Host githost
HostName git.host.de
Port 4019
User root

then you should be able to use the basic syntax:

git push githost:/var/cache/git/project.git master
Charles Bailey
A SSH config might be a workaround, but this got me interested, because man git-push says that the accepted ssh url format is ssh://[user@]host.xz[:port]/path/to/repo.git/
gnud
I'm not sure, it may be a configuration git/ssh version issue because I tried to push to a ssh://fake@localhost:333/fake address and got (as expected) "port 333: Connection refused".
Charles Bailey
+1  A: 

SSH doesn't use the : syntax when specifying a port. The easiest way to do this is to edit your ~/.ssh/config file and add:

Host git.host.de
  Port 4019

Then specify just git.host.de without a port number.

Greg Hewgill
+4  A: 

This avoids your problem rather than fixing it directly, but I'd recommend adding a ~/.ssh/config file and having something like this

Host git_host
HostName git.host.de
User root
Port 4019

then you can have

url = git_host:/var/cache/git/project.git

and you can also ssh git_host and scp git_host ... and everything will work out.

Peter