首页 > 解决方案 > 使用 Codenvy 推送到 GitHub 时出现问题:“无法存储 ssh 密钥。无法获取私有 ssh 密钥。”

问题描述

我正在为我的 rails 应用程序使用 Codenvy。当我git push -u origin --all使用我的 rails 应用程序运行时,我得到一个空白终端。当我使用 推动时Git > Remotes > Push menu,我收到错误“Can't store ssh key. Unable get private ssh key."

这是 OAuth 的问题吗,因为我还没有设置它。<HOST_IP>我尝试遵循 Codenvy git 文档,但他们没有提供有关在、<SERVER_PORT><CHE_HOST_IP>yourClientSecretyourClientID参数中填写什么内容的信息。我遵循了许多在线教程,试图将我的 Codenvy 应用程序连接到 GitHub,但都没有成功。我似乎找不到一种明确的方法来做到这一点。我是 Codenvy 的新手,你能向我解释一下吗?

复制步骤: 我已经:

更新:我已通过 git origin 修复,现在运行时git push -u origin -all,出现以下错误:

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Git-Ibraheem/toy_app.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

使用 Codenvy Git 菜单时,我得到了同样的错误:

failed to push 'master -> master' to 'https://github.com/Git-Ibraheem/toy_app.git'. Try to merge remote changes using pull, and then push again.

当我运行时,git pull origin master我得到以下信息:

error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.`

修复: 我运行了命令git reset --hard HEAD,然后git push -u origin --all. 这很成功!

标签: gitgithuboauthidecloud

解决方案


使用 git 远程添加来源 git@bitbucket.org:/

那应该是一个完整的网址git@bitbucket.org:/MyAccount/MyRepo

使用 VCS 在主机名“github.com”下生成 SSH 密钥,并将公共 ssh 添加到我的 GitHub 帐户

bitbucket那...与那时(您刚刚提到的“起源”)无关。

这是 OAuth 的问题吗?

如果您使用的是 SSH,则不涉及 OAuth,所以不。


推荐阅读