Heroku:如果你在heroku中有多个应用程序,你如何推送到特定的应用程序?
我使用heroku create test-app3
创建了一个新的heroku应用程序。 现在,如果我想将一些代码推送到这个新的test-app3
,我该怎么做?
当我在终端输入heroku list
时,我得到:我的应用程序
-
test-app1
-
test-app2
-
test-app3
我如何推送test-app3? 如何在要推送的应用程序之间切换?
您需要为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