然后我创建了一个远程作为origin,并将它作为github存储库的url:
git remote add origin git@github.com:squalporeover/wordpress-template.git
现在我想将我的主分支推送到该存储库。我运行了以下命令:
git push origin master
但它显示:
许可被拒绝(公钥)。
致命的:无法从远程存储库读取。请确保您拥有正确的访问权限 存储库存在。
答案 0 :(得分:0)
您需要使用ssh-keygen生成一个ssh密钥对。 请参阅:https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
在此处找到重复项:Git - Permission denied (publickey)
答案 1 :(得分:0)
看起来您添加了远程URL的SSH版本。要使用此功能,您需要set-up Github with SSH。
答案 2 :(得分:0)
这对我有用:
第一步- git remote rm origin
步骤 2-{{3}}
第 3 步 - 再次运行以下命令
git remote add origin select the http option in github
git branch -M main
git push -u origin main