I'm trying to create 2 different Heroku apps using the same code with the same git repository. App1 is created in Heroku by my friend and i'm not a collaborator and app2 is the branch of the same git repository that i'm trying to deploy. Is this possible?
I'm getting an error when i'm trying to deploy the 2nd app to Heroku:
$ git push heroku branch1:master
! [email protected] not authorized to access app1
fatal: The remote end hung up unexpectedly
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. I don't use the 'heroku' name as my remote though (not that it really matters) I use production and staging mapped to different Heroku applications. So I can do:
git push production master
or
git push staging staging:master
Check your remote endpoints via git remote -v
in the projects root. It will show the default heroku mapped to your application.
Get the URLs for your apps on Heroku via the dashboard and do
git remote add production <gitrepo for production app here>
git remote add staging <gitrepo for staging app here>
However, from the the error you've posted it looks like you're not a collaborator on the app1 application.
There is a really good guide out there in the Heroku Dev Center: https://devcenter.heroku.com/articles/multiple-environments
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