Heroku:如果你在heroku中有多个应用程序,你如何推送到特定的应用程序? [英] Heroku: How do you push to specific app if you have multiple apps in heroku?
问题描述
我使用 heroku创建test-app3
创建一个新的heroku应用程序。现在,如果我想将一些代码推送到这个新的 test-app3
,我该怎么做?
I create a new heroku app using heroku create test-app3
. Now if I want to push some code to this new test-app3
, how do I do that?
当我在终端输入 heroku list
时,我得到:
My Apps
When I type heroku list
in the terminal I get:
My Apps
-
test-app1
-
test-app2
-
test-app3
test-app1
test-app2
test-app3
如何推送至test-app3?
How do I push to test-app3? How do I switch between which app to push to?
推荐答案
您需要为每个应用程序设置不同的git远程端点Heroku,以便您可以推送到任一应用程序从一个本地回购。
You will need to setup different git remote end points for each application at Heroku so you can push to either application from the one local repo.
通过仪表板在Heroku上获取您的应用程序的GIT URL(它看起来类似于以下内容: git@heroku.com:your_app_name.git
)并执行:
Get the GIT URLs for your apps on Heroku via the dashboard (it will look something similar to this: git@heroku.com:your_app_name.git
) and do:
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
然后您将会能够推送到这样的任何特定的应用程序:
Then you will be able to push to any specific app like this:
git push test-app1 master
git push test-app2 master
git push test-app3 master
这篇关于Heroku:如果你在heroku中有多个应用程序,你如何推送到特定的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!