Deploying 2 different heroku apps with same code and git repository

前端 未结 2 1173
别那么骄傲
别那么骄傲 2021-01-30 23:56

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 collaborat

相关标签:
2条回答
  • 2021-01-31 00:23

    There is a really good guide out there in the Heroku Dev Center: https://devcenter.heroku.com/articles/multiple-environments

    0 讨论(0)
  • 2021-01-31 00:30

    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.

    0 讨论(0)
提交回复
热议问题