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
! my_email_id@gmail.com 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:
or
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
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