git - 使用 GitHub 个人 SSH key 不适用于组织 repo

标签 git github ssh

我正在尝试使用我的 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/

相关文章:

Git:致命:Pathspec 在子模块中

git - 插件 repo 的子模块或 .gitignore?

git - 是否可以在按存储日期描述时选择 git 存储?

git - 帐户 ssh-key 与部署 ssh-key 之间的区别

github - 如何使用 Jenkins 管道将测试覆盖率发布到 Github 拉取请求?

github - 如何为内部服务器的 Jenkins 配置 GitHub Webhook?

linux - 如何在登录时运行命令并将其显示在控制台中?

windows - 在 Windows 上为 Bitbucket 设置 SSH key

linux 命令行直接进入下一行

php - Magento索引器通过ssh运行但不是cron作业