解决Can’t finish GitHub sharing process Successfully created project ‘xxxx‘ on GitHub...方法

发布于:2023-02-05 ⋅ 阅读:(1461) ⋅ 点赞:(0)

一、问题简介:

今天使用idea中的Share projecgt on GitHub时,在push代码的时候,报如下错误

Can't finish GitHub sharing process
        Successfully created project 'xxxx' on GitHub, but initial push failed:
        git@github.com: Permission denied (publickey).
        Could not read from remote repository.
        Please make sure you have the correct access rights
        and the repository exists.

Push failed
        git@github.com: Permission denied (publickey).
        Could not read from remote repository.
        
        Please make sure you have the correct access rights
        and the repository exists.

 

 二、问题产生原因分析


1、客户端与服务端未生成 ssh key
2、客户端与服务端的ssh key不匹配

三、问题解决方法
 

1、Win+R打开命令行

 2、然后输入命令:ssh-keygen -t rsa -C "youremail@example.com",回车

特别注意:youremail@example.com需换成你GitHub的邮箱

 3、按照路径打开文件夹,以文本形式打开id_rsa.pub文件,并复制里面全部内容

4、打开GitHub的个人setting页面

5、点击SSH and GPK keys,再点击New SSH key,标题随意输入,把复制的内容粘贴进去,点击Add SSH Key即可

 

 

 6、使用idea,再次push代码,即可成功,问题解决

, 

本文含有隐藏内容,请 开通VIP 后查看