Heroku的:你如何推到特定的应用程序,如果你有在Heroku的多个应用程序?

Jam*_*cky 4 ruby ruby-on-rails heroku ruby-on-rails-4 ruby-on-rails-5

我使用创建一个新的heroku应用程序heroku create test-app3.现在,如果我想要把一些代码到这个新的test-app3,我该怎么做呢?

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

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

我如何推送test-app3?如何在要推送的应用程序之间切换?

K M*_*lam 12

您需要为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
Run Code Online (Sandbox Code Playgroud)

然后你就可以推送到这样的任何特定应用:

git push test-app1 master

git push test-app2 master

git push test-app3 master
Run Code Online (Sandbox Code Playgroud)