Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Alright, quick question.

When SSHing to a server using the IP, I can also specify a path to use, such as:

git clone ssh://git@127.0.0.1:/home/git/project.git SomeProject

However, when using a hostname, the command thinks the path is part of the host name:

git clone ssh://git@localhost.com:/home/git/project.git SomeProject

Which yields an error about the : before the path

ssh: localhost.com:: no address associated with name

(Yes, I am aware that I cannot SSH into localhost.com)

Is there a way to specify the path as in the IP example, but with a hostname?

Thanks!

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Why did you decide that a Git SSH URI must have a : after a hostname? Where did you see this format?

Formal SSH-URI specification is

ssh://[user@]host.xz[:port]/path/to/repo.git/
share|improve this answer
    
It's derived from scp notation. –  Jan Marek Jan 26 '12 at 8:54
    
That is the strangest thing.... I seriously could not get it working until now. One of those days, I guess. Thanks! –  Qix Jan 26 '12 at 8:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.