Closed vdias38 closed 5 years ago
I add integration remote env w/
$ git remote add staging git@heroku.com:enigmatic-spire-11550.git
and rename heroku to production
$ git remote rename heroku production
Then I can push to production with $ git push production master
command.
By default, the heroku CLI creates projects with a heroku git remote (thus the normal git push heroku master). As we change our remote names we need to use --remote
option of heroku CLI to define in which remote we are working.
$ heroku config:set GITHUB_USERNAME=joesmith --remote staging
To make things easier, you can use your git config (.git/config
) to specify a default app.
$ git config heroku.remote staging
Now all heroku commands will default to the staging app.
Source: Heroku - multiple environments
My .git/config
[remote "production"]
url = https://git.heroku.com/limitless-sea-32755.git
fetch = +refs/heads/*:refs/remotes/production/*
[remote "staging"]
url = https://git.heroku.com/enigmatic-spire-11550.git
fetch = +refs/heads/*:refs/remotes/staging/*
[heroku]
remote = staging
Requirements:
$ heroku login
$ heroku create --remote appname
To-do
Environments to Push
Important!
Don't forget to set your Config Variables: