Heroku + Github deployment

This is the straightforward approach I recently used to push some work on both Github and Heroku platforms. I think it might be improved with a Git post-receive hook; but let’s begin with a simple workflow for now.

# 1. Create an empty Git repository, or 'rails init my_app'
mkdir my_app
cd my_app && git init

# 2. Add the Github remote
git add remote github https://github.com/<user>/<repo>.git

# 3. Pull the existing history (if any) from the Github repository
git pull github master

# 4. Create an Heroku app (this step adds the Heroku remote)
heroku create

# 5. Commit some work
touch foo.c && git add -A && git commit -m "initial commit"

# 6. Push your commits to Github
git push github master

# 7. And roll out the commits to Heroku
git push heroku master

No magic here; I just use basic git commands.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s