我正在尝试使用我的 GitHub ssh key 之一,以便可以从 oranization/repo
推送和 pull .我刚刚创建了 key 并将其添加到我自己的帐户中。我按照 GitHub Generating SSH Keys page 上的所有说明进行操作.
当我做 ssh -T git@github.com
时,GitHub ssh 会认出我
但是,当我尝试 pull 或克隆时,GitHub 仍然要求我输入用户名/密码。我有权修改此存储库。
(vagrant)vagrant@vagrant-ubuntu-trusty-32:/vagrant$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
Hi getvictor! You've successfully authenticated, but GitHub does not provide shell access.
(vagrant)vagrant@vagrant-ubuntu-trusty-32:/vagrant$ git pull
Username for 'https://github.com':
任何想法如何解决它?
最佳答案
检查 Remote 'origin
' 你的 repo :
git remote -v
如果它包含 https,那么您的 ssh key 将无关紧要,因为它是 https 网址,而不是 ssh 网址。
您可以change it to an ssh one和:
git remote set-url origin git@github.com:USERNAME/REPOSITORY2.git
关于git - 使用 GitHub 个人 SSH key 不适用于组织 repo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25219182/