"no address associated with name" error when cloning github.com's repo under Windows using ssh
Solution 1
You answered it yourself - the problem is that you're passing github.com:piotr-dobrogost
as the hostname, which is, in fact, not a valid hostname. git will understand either proper URLs to a repository, or a repository path in SCP format (see man 1 scp
.) For a proper URL, try:
git clone ssh://[email protected]/piotr-dobrogost/requests.git
Which is equivalent to the following in SCP path format:
git clone [email protected]:piotr-dobrogost/requests.git
Solution 2
I had this same problem, and it's turn out it was DNS problem. The DNS settings were wrong and the machines simply could not reach the remote git repository.
Comments
-
Piotr Dobrogost almost 2 years
Searching google for
+github +ssh "no address associated with name"
gives the following SO questions as the 4 top results:github no address associated with name
Github push origin master not working
Syncing with github
GITHUB setup - no address associated with nameNone of them gives answer to my problem, though.
c:\Program Files (x86)\Git\bin>git --version git version 1.7.7.1.msysgit.0 c:\Program Files (x86)\Git\bin>ssh [email protected] Enter passphrase for key '/c/Users/Piotr/.ssh/id_rsa': Hi piotr-dobrogost! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed. c:\Program Files (x86)\Git\bin>git clone ssh://[email protected]:piotr-dobrogost/requests.git Cloning into requests... ssh: github.com:piotr-dobrogost: no address associated with name fatal: The remote end hung up unexpectedly
I guess the problem is caused by git passing
github.com:piotr-dobrogost
as the hostname to ssh instead justgithub.com
only. Why does git do this and what's the solution? -
Piotr Dobrogost over 12 yearsGithub gives
[email protected]:piotr-dobrogost/requests.git
(with colon) as the url to use with ssh. Bothgit clone ssh://[email protected]/piotr-dobrogost/requests.git
andgit clone [email protected]:piotr-dobrogost/requests.git
work but notgit clone ssh://[email protected]:piotr-dobrogost/requests.git
. Why does git handle colon when using url withoutssh
scheme and doesn't handle when using url withssh
scheme? -
Edward Thomson over 12 yearsBecause
ssh://[email protected]:username/repo
is not actually a URL that is equivalent tossh://[email protected]/username/repo
.[email protected]:username/repo
is not a URL at all - it's in the format of the SCP user@host:file argument type (seeman 1 scp
), which the git client translates into the proper format. -
Piotr Dobrogost over 12 yearsCould you please add information about git using scp format to your answer? Thanks.