[英]Visual Studio - Git clone fails over SSH, but works over HTTPS
I am using a fresh install of Visual Studio 2017 (15.8.1), and Git tools. 我正在使用Visual Studio 2017(15.8.1)和Git工具的全新安装。 When I try to clone an existing GitHub repository, either by using the commandline tools, or by using git tools, I receive the following error message:
当我尝试使用命令行工具或git工具克隆现有的GitHub存储库时,收到以下错误消息:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
I believe this error is caused by SSH and I cannot seem to make git use HTTPS. 我相信此错误是由SSH引起的,我似乎无法使git使用HTTPS。 Thanks in advance.
提前致谢。
If you are using 2-factor authentication at GitHub 如果您在GitHub上使用2要素身份验证
You must either do one of the following: 您必须执行以下任一操作:
If you want to clone any repository using https 如果要使用https克隆任何存储库
Simply clone it using the HTTPS-link instead of the SSH link. 只需使用HTTPS链接而不是SSH链接克隆它。 You can find both links here, by clicking on Use SSH , you can switch to the SSH link:
您可以在此处找到两个链接,通过单击Use SSH ,您可以切换到SSH链接:
就我而言,我必须删除〜/ .ssh / known_hosts文件,以便下次您通过ssh访问git时可以创建一个新文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.