Skip to content

Instantly share code, notes, and snippets.

I use this Capistrano task so I don't have manually do git push before cap deploy. It includes some error checking to make sure I'm on the right branch (master) and haven't got any uncommitted changes.

Simply add the code below to config/deploy.rb, then run cap deploy:push to test, and cap deploy to deploy as usual.

Change Log

  • Use branch fetch(:branch) rather than master.