【问题标题】:Heroku: Git error after application forkHeroku:应用程序分叉后的 Git 错误
【发布时间】:2015-07-08 10:41:14
【问题描述】:

设置:

我在 heroku 上部署了一个 Node.js(MEAN 全栈)应用程序(即 myApp),它运行良好。我使用标准 git push 部署

$ git push heroku master

我想创建应用程序的临时副本并使用 heroku fork 来执行此操作(根据 https://devcenter.heroku.com/articles/fork-app)。

$ heroku fork -a myApp myApp-staging

暂存应用程序也可以正常工作,使用自己的数据库并拥有自己的一组配置变量(预期)。 !!!重要

我还创建了一个新的 git 遥控器

$ git remote add staging git@heroku.com:myApp-staging.git
// repo address taken from "heroku info -a myApp-staging"

问题:

1) 如果我尝试推动生产,即。 “git push heroku master”它 工作正常。

2) 如果我尝试推送到 staging

$ git push staging master

我收到“权限被拒绝(公钥)”。
3)如果我尝试将我的暂存应用程序 git repo 克隆到另一个目录,我会得到一个空的 repo

$ heroku git:clone -a industryhub-staging
// warning: You appear to have cloned an empty repository

我的临时存储库在哪里? Heroku 在我的暂存实例上运行哪个代码?最后 - 我如何推动 staging?

【问题讨论】:

    标签: node.js git heroku push


    【解决方案1】:

    想通了。留给后代。

    错误是暂存应用的错误的遥控器。我用

    创建了它
    $ git remote add staging git@heroku.com:myApp-staging.git
    

    我有

    $ git remote -v
    heroku  https://git.heroku.com/myApp.git (fetch)
    heroku  https://git.heroku.com/myApp.git (push)
    staging git@heroku.com:myApp-staging.git (fetch) // wrong
    staging git@heroku.com:myApp-staging.git (push)  // wrong
    

    我应该做的

    $ git remote add staging https://git.heroku.com/myApp-staging.git // over https
    

    现在我的 git 显示了

    $ git remote -v
    heroku  https://git.heroku.com/myApp.git (fetch)
    heroku  https://git.heroku.com/myApp.git (push)
    staging https://git.heroku.com/myApp-staging.git (fetch) // OK
    staging https://git.heroku.com/myApp-staging.git (push)  // OK
    

    生活又是美好的!


    注意:Heroku 表示 新的 repo 在 fork 应用程序后为空https://devcenter.heroku.com/articles/fork-app#forked-app-state

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-16
      • 2019-01-21
      • 1970-01-01
      • 1970-01-01
      • 2013-03-18
      • 2020-07-22
      • 2011-12-18
      相关资源
      最近更新 更多