git - 使用 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>
、yourClientSecret
和yourClientID
参数中填写什么内容的信息。我遵循了许多在线教程,试图将我的 Codenvy 应用程序连接到 GitHub,但都没有成功。我似乎找不到一种明确的方法来做到这一点。我是 Codenvy 的新手,你能向我解释一下吗?
复制步骤: 我已经:
- 将我的 Git 用户信息添加到我的首选项中
- 使用添加了我的 GitHub 信息
git config --global user.name/email "name/email"
- 使用我的存储库名称添加了我的远程来源
git remote add origin git@bitbucket.org:/
- 使用 VCS 在主机名“github.com”下生成 SSH 密钥,并将公共 ssh 添加到我的 GitHub 帐户
更新:我已通过 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
. 这很成功!
解决方案
使用 git 远程添加来源 git@bitbucket.org:/
那应该是一个完整的网址git@bitbucket.org:/MyAccount/MyRepo
使用 VCS 在主机名“github.com”下生成 SSH 密钥,并将公共 ssh 添加到我的 GitHub 帐户
bitbucket
那...与那时(您刚刚提到的“起源”)无关。
这是 OAuth 的问题吗?
如果您使用的是 SSH,则不涉及 OAuth,所以不。
推荐阅读
- apache-spark - PySpark 如何从 Dataframe 架构的 StructType 对象中解析和获取字段名称
- node.js - 如何将多个 JSON 对象插入到模式的一个属性中?
- .net - 登录凭证与公共 IP 的映射
- odoo - Odoo:选择树视图项目应链接到特殊视图
- html - 一张图片在 prestashop 中隐藏了我的段落
- jmeter - 1 用户和 100 用户的加载时间差异太大
- python - 我们如何根据颜色标记散点图的图例
- python - 恢复传递给 multiprocessing.Process 的函数返回值的最快方法
- angular - 在 Typescript Angular 2 中加入数组
- configuration - Azure 边缘部署和配置