mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Push Non-master Branch to Heroku as a devops til.
This commit is contained in:
26
devops/push-non-master-branch-to-heroku.md
Normal file
26
devops/push-non-master-branch-to-heroku.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Push Non-master Branch To Heroku
|
||||
|
||||
When using git to deploy your app to Heroku, it is expected that you push
|
||||
to the `master` branch. When you run the following command
|
||||
|
||||
```
|
||||
$ git push heroku master
|
||||
```
|
||||
|
||||
Heroku will attempt to build and run your app. However, if you have a
|
||||
`staging` branch for your application that you want to push to your
|
||||
staging environment on Heroku, you cannot simply run
|
||||
|
||||
```
|
||||
$ git push heroku staging
|
||||
```
|
||||
|
||||
Heroku will only perform a build on pushes to the remote `master` branch.
|
||||
You can get around this, though, by specifying that your `staging` branch
|
||||
should be pushed to the remote `master` branch, like so
|
||||
|
||||
```
|
||||
$ git push heroku staging:master
|
||||
```
|
||||
|
||||
[source](https://coderwall.com/p/1xforw/make-heroku-run-a-non-master-branch)
|
||||
Reference in New Issue
Block a user