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.
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 
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With