Git clone, ssh: Could not resolve hostname
Now this was annoying. I tried a git clone ssh://email@example.com:/path/to/repository and it failed with
Initialized empty Git repository in /current/path/repository/.git/ ssh: Could not resolve hostname my.host:: Name or service not known fatal: The remote end hung up unexpectedly
The solution was rather easy, see man 1 git-clone. A valid git clone command looks like this:
git clone ssh://firstname.lastname@example.org/absolute/path/to/repo.git/
An alternative notation that allows for relative paths is
git clone email@example.com:relative/path/to/repo.git/
The problem with the command I used initially was that I tried to use an scp-like syntax.
Thanks for this :-)
By the way, if you had dropped the "ssh://" prefix then your original example would have worked.
Oh, nice, thanks :-)
Thanks for sharing this Nicolas and Tianon. Nice to be able to Google relevant information. :)
You just saved my day! I had my "Doh!"-moment as well now.