Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: How do you push to specific app if you have multiple apps in heroku?

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?

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

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

How do I push to test-app3? How do I switch between which app to push to?

like image 643
JamesRocky Avatar asked Sep 28 '15 03:09

JamesRocky


People also ask

How do I push to a specific Heroku app?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.


1 Answers

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.

Get the GIT URLs for your apps on Heroku via the dashboard (it will look something similar to this: https://[email protected]:your_app_name.git) and do:

git remote add test-app1 https://[email protected]:test-app1.git

git remote add test-app2 https://[email protected]:test-app2.git

git remote add test-app3 https://[email protected]: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
like image 94
K M Rakibul Islam Avatar answered Oct 16 '22 22:10

K M Rakibul Islam