Github ssh key 已添加,已检查,仍然无效

标签 github ssh ssh-keys

我按照这个创建了 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/

相关文章:

linux - 如何从expect脚本中捕获标准错误

php - 根据错误的凭证处理 'ssh2_auth_password()'错误

python - ssh-copy-id 有时会挂起

perl - 如何确定用户是否在 perl 脚本中有 ssh key

github - 设置新的 github 存储库 - 未知开关 `u'

git - 如何将 3 次提交压缩为 1 次?

github - 我可以使用 github 操作重命名文件吗?

git - 如何将 git 与 dropbox 和 usb-stick/thumbdrive 一起使用

Windows 7. Git公钥配置

git - git pull 密码错误 - 重新提示密码?