tags:

views:

44

answers:

1

A colleague of mine has a remote git repo that I wanted to clone and he provided a url of [email protected]:443/repo.git. ssh is listing on port 443 in this case.

I tried to clone by doing git clone [email protected]:443/repo.git but the operation times out. I had thought git defaults to ssh as its protocol and I'm not sure why this does not work.

If I explicitly specify ssh in the url like git clone ssh://[email protected]:443/repo.git it works just as normal.

Is that expected git behavior? Why does the first url not work but the second one does?

+5  A: 

Yeah. The "default" clone syntax is scp-like. scp URLs look like "user@host:path". Note the colon; if you use [email protected]:443/repo.git, Git thinks you're trying to clone a path 443/repo.git from [email protected]. If you need to specify a port, you have to use the ssh-style syntax (as you ended up doing).

mipadi
Or use `.ssh/config` to specify port.
Jakub Narębski