Created
January 2, 2009 21:09
-
-
Save neilmock/42699 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
namespace :git do | |
desc "hack" | |
task :hack, [:target_branch] do |t, args| | |
require 'git' | |
# assume current working directory | |
g = Git.open('.') | |
args.with_defaults(:target_branch => "master") | |
current_branch = g.current_branch | |
`git checkout #{args.target_branch}` | |
`git pull origin #{args.target_branch}` | |
`git checkout #{current_branch}` | |
`git rebase #{args.target_branch}` | |
end | |
desc "ship" | |
task :ship, [:target_branch] do |t, args| | |
require 'git' | |
# assume current working directory | |
g = Git.open('.') | |
args.with_defaults(:target_branch => "master") | |
current_branch = g.current_branch | |
`git checkout #{args.target_branch}` | |
`git merge #{current_branch}` | |
`git push origin #{args.target_branch}` | |
`git checkout #{current_branch}` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment