我按照这个创建了 ssh key tutorial .
将其分配给 ssh-agent。
按此将其添加到 github 帐户 tutorial .
ssh-add -l -E md5
显示正确的足迹
ssh -T git@github.com
说:
Hi <My username>! You've successfully authenticated, but GitHub does not provide shell access.
但仍然:
git push
要求:
Username for 'https://github.com':
任何的想法?提前致谢。
最佳答案
看看这个:switching-remote-urls-from-https-to-ssh
高是您通过 HTTPS 克隆存储库并且现在想要使用 SSH 推送的更改。
正如 GitHub site 上的建议通过执行以下操作检查您的远程来源:
$ git remote -v
origin https://github.com/USERNAME/REPOSITORY.git (fetch)
origin https://github.com/USERNAME/REPOSITORY.git (push)
如果您有
https...
将其更改为 ssh
通过做这样的事情:git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
关于Github ssh key 已添加,已检查,仍然无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49497650/