使用ssh在Windows下克隆github.com的repo时,“no address associated with name”错误

前端之家收集整理的这篇文章主要介绍了使用ssh在Windows下克隆github.com的repo时,“no address associated with name”错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Searching google for github ssh“no address associated with name”给出以下SO问题作为4个顶级结果:

github no address associated with name
Github push origin master not working
Syncing with github
GITHUB setup – no address associated with 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

猜你在找的Windows相关文章