Skip to content

Instantly share code, notes, and snippets.

@royratcliffe
Created March 17, 2011 13:06
Show Gist options
  • Save royratcliffe/874282 to your computer and use it in GitHub Desktop.
Save royratcliffe/874282 to your computer and use it in GitHub Desktop.
namespace :heroku do
desc "Push current branch to Heroku master"
task :push do
current_git_branch = %x(git branch).split("\n").select { |line| line =~ /^\* / }.map { |line| line[2..-1] }[0]
puts "Pushing branch #{current_git_branch} to Heroku"
%x(git push heroku #{current_git_branch}:master)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment