搜索谷歌+github +ssh "no address associated with name"
提供以下SO问题作为4个最佳结果:
github没有与名称关联的地址
Github push origin master not working
与github GITHUB设置同步
- 没有与name关联的地址
但是,他们都没有回答我的问题.
c:\Program Files (x86)\Git\bin>git --version git version 1.7.7.1.msysgit.0 c:\Program Files (x86)\Git\bin>ssh git@github.com 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://git@github.com:piotr-dobrogost/requests.git Cloning into requests... ssh: github.com:piotr-dobrogost: no address associated with name fatal: The remote end hung up unexpectedly
我猜这个问题是由git github.com:piotr-dobrogost
作为主机名传递给ssh 引起的,而不仅仅是github.com
.为什么git会这样做,解决方案是什么?
你自己回答了 - 问题是你github.com:piotr-dobrogost
作为主机名传递,实际上,它不是有效的主机名.git将理解存储库的正确URL或SCP格式的存储库路径(请参阅man 1 scp
.)要获得正确的URL,请尝试:
git clone ssh://git@github.com/piotr-dobrogost/requests.git
这与SCP路径格式中的以下内容相同:
git clone git@github.com:piotr-dobrogost/requests.git