问题:
使用 git 上传项目时,报错:git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
原因:
缺少SSH KEY,即是密钥。
解决方法:
- 在 github 上,找到 setting ,然后找到 SSH and GPG keys.
- 找到最上面一行的 SSH keys .右侧的 new SSH key
- 在项目根目录打开 Git Bash,然后安装下面3行命令输入即可。
ssh-keygen -t rsa -C "2817068860@qq.com"
cat ~/.ssh/id_rsa.pub
git push --set-upstream origin master