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

xiaoxiao2025-08-24  130

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 "your_email@example.com"

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

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

此时再git clone:

clone 成功!

 

转载请注明原文地址: https://www.6miu.com/read-5035215.html

最新回复(0)