[email protected]: Permission denied (publickey).fatal: Could not read from remote repository

使用 git 将本地库推送到远程库上,使用如下语句

$ git push -u origin master

但是出现下列提示

[email protected]: Permission denied (publickey).

fatal: Could not read from remote repository 

Pleasemake sure you have the correct access rights and the repository exists.

解决办法:https://blog.csdn.net/chaoyueziji123/article/details/54669555

主要是使用 ssh-keygen -t rsa -C “邮箱地址” 生成 id_rsa.pub文件,将文件内容复制到SSH keys即可.

所以在使用git前准确配置自己的邮箱是有必要的

git config –global user.name “yourname”
git config –global user.email “youremail”

 

 

 

 

你可能感兴趣的:(LearnGit)