When gitos-admin with
git clone ssh://gitosis@192.168.1.1:gitosis-admin.git
I couldn't connect because ssh is connecting to port 22 and my ssh is running on 2211. So, I searched the internet for a solution. It should be as easy as adding the port to my .ssh/config file. I added the following to the file (which I hat to create)
Host bml
HostName 192.168.1.1
Port 2211
When executing:
git clone ssh://gitosis@bml:gitosis-admin.git
I get the following error:
Cloning into 'gitosis-admin'...
ssh: connect to host port 22: Bad file number
fatal: The remote end hung up unexpectedly
Which suggest that my config file is invalid or my config file is not used.
So... I tested it with a host that didn't exist
git clone ssh://gitosis@bmlsomething:gitosis-admin.git
Which resultated in the same error as before
Cloning into 'gitosis-admin'...
ssh: connect to host port 22: Bad file number
fatal: The remote end hung up unexpectedly
This suggests that the config file is not used (okey could still be an invalid file, but would expect atleast a different error).
How can I fix this? BTW, I'm on Windows 7 :-s.
According to this, git clone ssh://user@host:port/repository
should work.
As far as I'm aware, the ~/.ssh/config
is not used by Windows.
EDIT: This question is also discussed here.