From 517024a2234268d4ab50fc640987e5618406d197 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 16 May 2015 17:15:56 -0500 Subject: [PATCH] Add Push Non-master Branch to Heroku as a devops til. --- README.md | 4 ++++ devops/push-non-master-branch-to-heroku.md | 26 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 devops/push-non-master-branch-to-heroku.md diff --git a/README.md b/README.md index c27a6b6..32cbe8b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Swap Two Items in a Vector](clojure/swap-two-items-in-a-vector.md) - [Type of Anything](clojure/type-of-anything.md) +### devops + +- [Push Non-master Branch To Heroku](devops/push-non-master-branch-to-heroku.md) + ### git - [Accessing a Lost Commit](git/accessing-a-lost-commit.md) diff --git a/devops/push-non-master-branch-to-heroku.md b/devops/push-non-master-branch-to-heroku.md new file mode 100644 index 0000000..b7fc27f --- /dev/null +++ b/devops/push-non-master-branch-to-heroku.md @@ -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)