【问题标题】:Heroku: How do you push to specific app if you have multiple apps in heroku?Heroku:如果您在 Heroku 中有多个应用程序,您如何推送到特定应用程序?
【发布时间】:2015-12-25 06:02:51
【问题描述】:

我使用heroku create test-app3 创建了一个新的heroku 应用程序。现在,如果我想将一些代码推送到这个新的test-app3,我该怎么做?

当我在终端中输入heroku list 时,我得到: 我的应用

  • test-app1
  • test-app2
  • test-app3

如何推送到 test-app3?如何在推送到哪个应用之间切换?

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-4 heroku ruby-on-rails-5


    【解决方案1】:

    您需要在 Heroku 为每个应用程序设置不同的 git 远程端点,以便您可以从一个本地存储库推送到任一应用程序。

    通过仪表板获取您在 Heroku 上的应用程序的 GIT URL(看起来类似于:git@heroku.com:your_app_name.git)并执行以下操作:

    git remote add test-app1 git@heroku.com:test-app1.git
    
    git remote add test-app2 git@heroku.com:test-app2.git
    
    git remote add test-app3 git@heroku.com:test-app3.git
    

    然后您将能够像这样推送到任何特定应用:

    git push test-app1 master
    
    git push test-app2 master
    
    git push test-app3 master
    

    【讨论】:

    • 我收到了fatal: Not a git repository ,所以我输入了git init,但现在如果我输入git remote add test-app1,我会收到usage: git remote add [<options>] <name> <url>。我该怎么办?
    • 你的输出是什么:git remote -v?
    • 你这样做了吗? git remote add test-app1 <gitrepo for test-app1 here>?那么当你这样做时应该能够看到一些东西:git remote -v
    • gitrepo,我没有那样做。我没有 github,所以我在哪里可以得到 gitrepo
    猜你喜欢
    • 2011-09-22
    • 2015-01-01
    • 1970-01-01
    • 2010-12-30
    • 2019-10-11
    • 1970-01-01
    • 1970-01-01
    • 2011-09-20
    • 1970-01-01
    相关资源
    最近更新 更多