How can I deploy old commits to Heroku

We’re trying to deploy a big Rails project to Heroku for the first time, but something’s breaking during the Heroku compilation process and we have no way of knowing what.

So now we’re going to plan B, which is to walk up the commit chain and test deploy each step of the way against Heroku until we figure out at which point it becomes un-compileable. (Yea, it’s the best I could come up with at this point.)

So I figured I’d just clone the project locally, checkout some old commits, and push to heroku. But then I discovered that if I push to heroku from anything but master, it doesn’t build the app?? Instead it says: “Pushed to non-master branch, skipping build.”

So now even my bad plan is a non-starter. I’m just looking for a break here. Any ideas on how to do what im trying to do?

  • Reading the first line of a file in Ruby
  • How to avoid tons of commits when debugging Heroku app
  • Capistrano deploy configuration
  • Setting the right path on Heroku for a vendor library
  • Heroku:The page you were looking for doesn't exist No route matches “/”
  • Capistrano Deploy not fetching latest commit from GitHub
  • Rails Migrations: the code evolved and the migration is not valid anymore : what to do?
  • Ruby gem error while trying to login to openshift via terminal
  • 2 Solutions collect form web for “How can I deploy old commits to Heroku”

    It’s not that Heroku only builds if you push from master, rather Heroku will only build if you push to master. If you just do

    git push heroku
    

    then you are probably pushing your local branch to one with the same name on Heroku (the exact default behaviour is configurable). You can push from a different local branch to Heroku master with

    git push heroku my_local_branch:master
    

    or, if you are already checked out on my_local_branch you could use

    git push heroku HEAD:master
    

    See the documentation for git push – the examples towards the end in particular may help.

    You will probably also need to use -f to force the push:

    git push -f heroku my_local_branch:master
    

    It’s a lot easier to achieve the desired result with heroku instead of the multi-step git process of checking in code, and pushing it. This keeps your git history clean.

    $ heroku releases
    $ heroku rollback v11
    
    Git Baby is a git and github fan, let's start git clone.