Skip to content

Instantly share code, notes, and snippets.

View MichalRemis's full-sized avatar

Michal Remis MichalRemis

  • NVSK s.r.o.
  • Slovakia
View GitHub Profile
@MichalRemis
MichalRemis / deploy.rb
Last active November 2, 2016 16:36
Ruby on Rails: Automatically push changes to Git repository before deploying with Capistrano (cap deploy)
# I use this Capistrano task so I don't have manually run '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 it, and 'cap deploy' to deploy as usual.
namespace :deploy do
desc "Push local changes to Git repository"
task :push do