git使用过程中遇到的问题及解决办法

版权声明:欢迎大家一起来交流学习!转载注明出处即可。 https://blog.csdn.net/Mliangydy/article/details/83382455

1.git clone

想在公司电脑上克隆github项目到本地,结果git clone 失败,如下图:

看信息应该是没有公钥导致无法克隆项目导致的。现在根据官方文档生成一个公钥:

github help:https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

ssh-keygen -t rsa -b 4096 -C "[email protected]"

默认是保存在C:\Users\xxx(用户)\.ssh下

然后打开该.ssh目录下的id_rsa.pub文件,将内容复制,打开github设置,找到SSH and GPG Keys(https://github.com/settings/keys),添加key,将刚刚复制的内容粘贴,保存

此时再git clone:

clone 成功!

猜你喜欢

转载自blog.csdn.net/Mliangydy/article/details/83382455