为什么git://可以工作但是git @不能 [英] Why does git:// works but git@ does not

查看:81
本文介绍了为什么git://可以工作但是git @不能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git://为什么起作用

Why does git:// works

$ git clone git://github.com/schacon/grit.git
Cloning into 'grit'...
...
Checking connectivity... done.

但git @不会

$ git clone git@github.com:schacon/grit.git mygrit
Cloning into 'mygrit'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to t
he list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

感谢您的帮助

推荐答案

这是因为git @使用ssh协议.它等效于ssh://git @..因此,如果您没有正确的ssh密钥,它将无法使用.选项git://但是使用git协议,该协议与ssh相似,但完全不使用身份验证.有关更多信息,请参见协议章节.

This is because git@ uses ssh protocol. It is equivalent to ssh://git@.. So if you dont have correct ssh keys it will not work. Option git:// however uses git protocol which is similar to ssh but uses no authentication at all. See chapter on protocols for more information.

这篇关于为什么git://可以工作但是git @不能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆