首页 > 解决方案 > 使用 SSH 进行 GIT 推送

问题描述

我很难找到有关创建 SSH 密钥的可靠信息,以便在为主存储库和单独的嵌套存储库执行 git push 和 pull 时不需要用户名和密码。

为了确保我没有现有的错误,从 https://github.com/settings/keys中删除了它们 然后按照本指南进行操作,简而言之建议:

检查是否存在,我也从这里删除了所有内容

ls -al ~/.ssh

然后(接受没有密码的默认值)

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
clip < ~/.ssh/id_rsa.pub

并在https://github.com/settings/keys粘贴密钥

该指南似乎到此结束,但是尝试推送回购给出:

fatal: HttpRequestException encountered.
   An error occurred while sending the request.
Username for 'https://github.com':

请问这里遗漏了哪些步骤。

尝试通过 git bash 推送

标签: githubsshpush

解决方案


推荐阅读