进行新项目初始化 提交过程中出现了以下错误

原因:电脑公钥(publickey)未添加至github,所以无法识别。 因而需要获取本地电脑公钥,然后登录github账号,添加公钥至github就OK了
解决方案:
查看本地是否有 SSH密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹:
没有的话--
生存密钥:
ssh-keygen -t rsa -C “youremail”
按3个回车,密码为空。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.The key fingerprint is:

进入 id_rsa.pub 复制密钥
然后 登录github后,进入个人设置settings--->ssh and gpg keys-->new ssh key 添加即可。title自行命名



把刚才复制的密码 粘贴到下边的 key就可以了 title 随便填写

然后github 就识别你的机器了 就可以拉取和提交代码了。
网友评论