We've all been there, you have changes that haven't been QAed, but there's a hotfix that needs to go out yesterday. Pantheon is a great host, but it has one major gotcha: you can't switch code branches. The way Pantheon works is the Pantheon Remote git library gets one, and only one branch. There's no way to switch branches. Code can only be promoted from staging->test->live. This is problematic, especially if you're coming from various deployment management utilities that let you switch branches or platform-as-a-service like Heroku.

Pantheon's recommended work flow

Image Credit: Pantheon, Use the Pantheon Workflow

Pantheon does offer multi-dev which essentially creates a separate branch for testing (and which can be promoted to the main chain) but still doesn't fix the hotfix issue.

Pantheon Hotfix Flow

  1. Create a local branch and reset to the last commit that was made live (this is a pain as Pantheon doesn't show last commit git hashes)
  2. Make changes locally. Commit the changes to your new branch.
  3. git push -f Pantheon YOURBRANCHHERE:master
  4. Promote from Dev -> Test -> Live from the control panel
  5. Make sure your hotfix is merged into your master local (and your origin)
  6. Reset Pantheon’s Dev to the master branch git push -f Pantheon master:master

Despite being warned that you should never use git force, this is the cleanest method. You can push up your desired hotfix and leave it on the live environment until your normal deploy chain overwrites it.