github上传项目的时候报权限错误
报出git@github.com: Permission denied (publickey). fatal: Could not read from remote repo 类似错误
解决方法
-
当前项目内输入命令:
ssh-keygen -t rsa -C ["xxxxxxxx@qq.com](mailto:"876818551@qq.com)"
-
接下来输入命令:
cat ~/.ssh/id_rsa.pub
。 -
接下来输入
git push --set-upstream origin master
-
复制里面的key。
-
从github主页点击设置进入SSH and GPG keys
-
点击创建一个新的密钥"New SSH key",
-
粘贴key。
如果配置了SSH密钥后,首次上传git代码继续报权限错误
unable to access 'https://github.com/xxxxxxxxx/test-app.git/': OpenSSL SSL_read: Connection was reset, errno 10054
解决方法
git remote rm origin
// 使用http明文传输
git remote add origin http://github.com/xxxxxxxxx/test-app.git/
//上传完成后,将远程地址改为