配置了sshkey后git clone仍然报错:make sure you have the correct access rights and the repository exists.

在Win10环境中经常遇到配置了sshkey后git clone仍然报错:Please make sure you have the correct access rights and the repository exists.
下面记录了我如何解决该问题的方法:
步骤1:删除用户目录下的.ssh文件夹
步骤2:重新生成sshkey

ssh-keygen -t rsa -C "用户邮箱"

步骤3:修改git的ssh配置
一般默认安装的git的ssh_config文件所在路径为:C:\Program Files\Git\etc\ssh\ssh_config
打开文件在文件最后,添加如下内容(其中Host以code.aliyun.com为例):

Host code.aliyun.com
	IdentityFile ~/.ssh/id_rsa
	HostkeyAlgorithms +ssh-rsa
	PubkeyAcceptedAlgorithms +ssh-rsa

步骤4:登录git仓库网站配置sshkey的页面,将id_rsa.pub文件中的内容添加。

最后重新尝试运行git clone命令拉取代码
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值