Last active
August 29, 2015 14:16
-
-
Save alexbasson/46ad72e1a313c115b948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def system_or_exit(cmd, stdout = nil) | |
puts "Executing #{cmd}" | |
cmd += " > \"#{stdout}\"" if stdout | |
system(cmd) or raise "******** Build failed ********" | |
end | |
namespace :git do | |
desc "Merge feature branch" | |
task :merge do | |
system_or_exit 'git checkout master' | |
system_or_exit 'git diff origin/master..HEAD --quiet --exit-code' | |
system_or_exit 'git reset origin/master --hard' | |
system_or_exit 'git pull --rebase' | |
system_or_exit 'git checkout -' | |
system_or_exit 'git rebase master' | |
system_or_exit 'git checkout -' | |
system_or_exit 'git merge --no-ff -' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment