我使用 heroku create test-app3
创建了一个新的 heroku 应用程序。现在,如果我想将一些代码推送到这个新的 test-app3
,我该怎么做?
当我在终端输入 heroku list
时,我得到:
我的应用
test-app1
test-app2
test-app3
如何推送到 test-app3?如何在推送到哪个应用之间切换?
最佳答案
您需要为 Heroku 中的每个应用程序设置不同的 git 远程端点,以便您可以从一个本地存储库推送到任一应用程序。
通过仪表板获取您在 Heroku 上的应用的 GIT URL(它看起来类似于:https://git@heroku.com:your_app_name.git
)并执行:
git remote add test-app1 https://git@heroku.com:test-app1.git
git remote add test-app2 https://git@heroku.com:test-app2.git
git remote add test-app3 https://git@heroku.com:test-app3.git
然后你就可以像这样推送到任何特定的应用程序:
git push test-app1 master
git push test-app2 master
git push test-app3 master
关于ruby-on-rails - Heroku:如果你在 heroku 中有多个应用程序,你如何推送到特定的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32815483/