使用 git 将本地库推送到远程库上,使用如下语句
$ git push -u origin master
但是出现下列提示
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository
Pleasemake sure you have the correct access rights and the repository exists.
主要是使用 ssh-keygen -t rsa -C “邮箱地址” 生成 id_rsa.pub文件,将文件内容复制到SSH keys即可.
所以在使用git前准确配置自己的邮箱是有必要的
git config –global user.name “yourname”
git config –global user.email “youremail”