Heroku:如果你在 heroku 中有多个应用程序,你如何推送到特定的应用程序? [英] Heroku: How do you push to specific app if you have multiple apps in heroku?

查看:32
本文介绍了Heroku:如果你在 heroku 中有多个应用程序,你如何推送到特定的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 heroku create 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 时,我得到:我的应用

When I type heroku list in the terminal I get: My Apps

  • 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?

推荐答案

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

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆