Photo-1 Photo-2 Photo-3 Photo-4 Photo-5 Photo-6



Full-time web developer. Part-time smart ass.

I'm Brent Collier.

After a year and a half as an engineer on Twitter's Trust & Safety team, I'm looking for my next gig. Contact me if you know of something interesting.


Pushing a Topic Branch to Heroku

Posted on 06/24/2011

This is one of those problems that I run into infrequently enough that I don't always immediately remember the answer. It usually happens when I'm working on a local topic branch and I try to push it to our staging instance on Heroku.

I push my code as usual, using

git push heroku master

Then I go to test my changes, and wtf? Its like nothing's changed at all. Then I usually try one or more of the follow things:

  • Doing a push with the --force option
  • Commiting some trivial whitespace-only change
  • Attempt to test any model-related changes via the console
  • Add a raise "boom" somewhere and commit/push, expecting an exception
  • Curse at the computer

Then, at some point, I remember that heroku always commits the master branch. Doh! No wonder I wasn't seeing any of my changes. So I reset head back to somewhere before all of the useless commits of the last 5 minutes, and then push my topic branch like so:

git push heroku branch_name:master

Suddenly everything works as intended and I no longer want to strangle kittens.