Git push 后提示 Permission denied(publickey).
使用 git@github.com:XXX/hello_laravel.git 的方式 push 报如下错误,反反复复从零部署测试了很多遍都是这个问题,我用的是 Mac。
cd ~/Code/Laravel
git remote add origin git@github.com:XXX/hello_laravel.git
git push -u origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
改换 git remote add origin https://github.com/XXX/hello_laravel.git 的方式输入 Github 的用户名和密码的形式就没问题,可以成功上传项目。
cd ~/Code/Laravel
git remote add origin https://github.com/XXX/hello_laravel.git
git push -u origin master
不过连密钥形式的上传都没搞通始终是个问题,请大家帮忙看看。
推荐文章: