4

I have 2 apps in Heroku, one is production app and one is staging. I have configured production app remote as 'heroku' and staging app remote as 'heroku-staging' so that I can deploy to production as follows

git push heroku master

and in staging as follows:

git push heroku-staging master

Now, I want to push code to staging app from my 'staging' branch instead of master branch. I want to accomplish this

git push heroku-staging staging  

If I run the above command, Heroku skips deployment saying branch is neither 'master' nor 'main' so skipping the build.

Mohsin Sethi
  • 803
  • 4
  • 16

1 Answers1

2

You can try the below command:

git push heroku-staging staging:master

When you want to go back, you can use the below command:

git push -f heroku master:master 
Harshana
  • 5,151
  • 1
  • 17
  • 27