Skip to content

Instantly share code, notes, and snippets.

Michael Nutt mnutt

Block or report user

Report or block mnutt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
brynary / git.rb
Created Dec 7, 2010
git:warn_unpushed_changes cap task
View git.rb
Capistrano::Configuration.instance(:must_exist).load do
namespace :git do
task :warn_unpushed_changes do
master_rev = `git rev-parse master`.strip
origin_master_rev = `git rev-parse origin/master`.strip
if master_rev != origin_master_rev
puts "*" * 80
answer = Capistrano::CLI.ui.ask(" You have local commits that have yet to be pushed to origin. Continue? (y/N)")
exit(1) unless answer.downcase == 'y'
You can’t perform that action at this time.