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.)

  • How do Git LFS and git-annex differ?
  • Git: Merging changes after branching before a revert
  • git rebase -i -autosquash conflict
  • Using git for managing a book's example source code: how to propagate changes?
  • How can I find out what version of git I'm running?
  • Heroku Cedar Python: requirement in github - clone fails with error 128
  • 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?

  • Git Clean Filter Breaking on Empty Files
  • ssh: Could not resolve hostname + STATUS_ACCESS_VIOLATION at eip=68086014
  • How to apply a git patch from one repository to another?
  • .gitconfig not following bash alias for default editor command?
  • git in a web development team using 1 remote dev server and no local dev environment
  • How to change folder with git bash?
  • 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.