KAE*_*EDE 5 php git ssh github htdocs
我想在 PHP 学习期间在 GitHub 上托管我的存储库。
我将远程 url 设置为kaede0902/phpto htdocs/workspace,并尝试拉取。我用的是须藤。
kaede@kaede-ThinkPad-T450:/opt/lampp/htdocs/workspace$ sudo git pull origin master
Warning: Permanently added the RSA host key for IP address '52.69.186.44' to the list of known hosts.
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.
Run Code Online (Sandbox Code Playgroud)
我的 ssh 网址是git@github.com:kaede0902/php.git.
我正在使用 ssh 连接其他存储库。
问题是什么?
Cod*_*ard 11
您必须将 ssh 密钥添加到两台机器。
该错误意味着您的计算机上没有 ssh。
您可以从任何计算机复制现有的计算机或创建新计算机。
打开 Git Bash。
运行ssh-keygen并按照屏幕上的消息进行操作(或者只需单击Enter直到结束)
复制位于以下位置的密钥文件(公钥的内容):
~/.ssh/id_rsa.pub
Run Code Online (Sandbox Code Playgroud)
将存储库 url 更改为 ssh
git remote set-url origin <ssh url>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9327 次 |
| 最近记录: |