【发布时间】:2018-03-16 11:27:06
【问题描述】:
Ionic Pro 使用 git 访问您编写的代码,以便将其克隆到他们的云服务中 - 这样做是为了他们可以代表您构建您的应用程序。他们的文档摘录:
Ionic Pro uses git to manage new app builds, push app updates, and more.
Before using Ionic Pro's git workflow, you must add a valid SSH key to your
account.
Ionic Pro's git service is not a replacement for your source code management
service of choice, such as GitHub or GitLab.
我想提请注意这一行:Before using Ionic Pro's git workflow, you must add a valid SSH key to your account.。如果您还没有 Ionic 并为您生成一个并将其链接到您的帐户,Ionic 可以很好地帮助您解决这个问题,我做到了。到目前为止,我可以做一些工作,然后使用git push ionic master 提交并将我的更改推送到 ionic git(以启动云构建);没有问题。
我现在已经完成了原型设计,想开始认真的开发并将项目添加到我自己的 Github 存储库中。所以我尝试运行git remote add origin git@github.com:AccountName/AppName.git。这执行没有问题。但是,当我尝试运行 git push -u origin master 时,我收到错误 fatal: Authentication Failed。由于 Ionic 设置了 repo,它还设置了用于身份验证的 SSH 密钥,但我不知道该过程实际上是如何工作的。目前我的 git bash 环境设置为我的 Github 帐户设置为我的用户名和密码,但我不知道如何将此基于 SSH 的存储库链接到我的 Github 用户名:基于密码的存储库。我使用 Git Bash 并将我的公共 SSH 密钥复制到我的 GitHub SSH 密钥中:
这也是我机器上唯一的公共 SSH 密钥:
但是,如果我尝试运行 git push -u origin master,我仍然会收到此错误:
【问题讨论】:
-
是的。您需要将您的公钥添加到您的 github 帐户。
-
我尝试按原样复制该密钥,但我收到错误“密钥无效。它必须以'ssh-ed25519'、'ssh-rsa'、'ssh-dss'开头'、'ecdsa-sha2-nistp256'、'ecdsa-sha2-nistp384'或'ecdsa-sha2-nistp521'"
-
您是否复制了公钥的内容?仔细检查these instructions
-
公钥?抱歉,我不确定在哪里找到它。
-
您是否阅读了我链接的说明?
标签: git github ionic-framework ssh