Shortcutting Heroku Deployments

Less than a minute to read

If you are familiar with Heroku, you may know that deploying is as easy as pushing to their remote repository:

$ git push heroku

But, this can get really monotonous, especially if you're frequently pushing to a staging app (then you have to specify the branch name as well). To make things a little easier I whipped up a quick shell function to make deployments a snap. <!--more-->

We always name our Heroku remotes staging and production. To deploy to staging, for instance, just pass the branch name you want to deploy:

$ deploy dev

Here's the function. Just drop it in your .bashrc (or whatever shell config you use).