<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,35 +34,30 @@ module GitCommands
     puts run(&quot;git diff origin/staging origin/production&quot;)
   end
 
-  def self.push_to(src_branch, dst_branch)
+  def self.push(src_branch, dst_branch)
     raise &quot;origin/#{dst_branch} branch does not exist&quot; unless remote_branch_exists?(&quot;origin/#{dst_branch}&quot;)
     ensure_clean_working_directory!
     begin
       run &quot;git fetch&quot;
-      run &quot;git branch -f #{dst_branch} origin/#{dst_branch}&quot;
-      run &quot;git checkout #{dst_branch}&quot;
-      run &quot;git pull origin #{src_branch}&quot;
-      run &quot;git push origin #{dst_branch}&quot;
+      run &quot;git push -f origin #{src_branch}:#{dst_branch}&quot;
     rescue
-      puts &quot;Pushing to origin/#{src_branch} to origin/#{dst_branch} failed.&quot;
+      puts &quot;Pushing #{src_branch} to origin/#{dst_branch} failed.&quot;
       raise
-    ensure
-      run &quot;git checkout master&quot;
-      run &quot;git branch -D #{dst_branch}&quot;
     end
   end
  
   def self.push_staging
-    push_to(&quot;master&quot;, &quot;staging&quot;)
+    push(current_branch, &quot;staging&quot;)
   end
  
   def self.push_production
-    push_to(&quot;staging&quot;, &quot;production&quot;)
+    push(&quot;origin/staging&quot;, &quot;production&quot;)
   end
  
   def self.branch_production(branch)
-    raise &quot;Branch must not be blank&quot; if branch.blank?
+    raise &quot;You must specify a branch name.&quot; if branch.blank?
     ensure_clean_working_directory!
+    run &quot;git fetch&quot;
     run &quot;git branch -f #{branch} origin/production&quot;
     run &quot;git checkout #{branch}&quot;
   end
@@ -75,12 +70,12 @@ end
  
 namespace :git do
   namespace :push do
-    desc &quot;Merge origin/master into the origin/staging branch.&quot;
+    desc &quot;Reset origin's staging branch to be the current branch.&quot;
     task :staging do
       GitCommands.push_staging
     end
  
-    desc &quot;Merge origin/staging branch into origin/production for launch.&quot;
+    desc &quot;Reset origin's production branch to origin's staging branch.&quot;
     task :production do
       GitCommands.push_production
     end
@@ -108,8 +103,6 @@ namespace :git do
   namespace :branch do
     desc &quot;Branch origin/production into BRANCH locally.&quot;
     task :production do
-      branch = ENV['BRANCH'].blank? ? GitCommands.current_branch : ENV['BRANCH']
-      puts &quot;Branching origin/production into #{branch}&quot;
       GitCommands.branch_production(branch)
     end
   end</diff>
      <filename>tasks/git.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>11764cefe968e3823b1912f92d19e04a58585eb7</id>
    </parent>
  </parents>
  <author>
    <name>Jon Yurek</name>
    <email>jyurek@thoughtbot.com</email>
  </author>
  <url>http://github.com/aussiegeek/limerick_rake/commit/a24f1e58ddb3c0ef14d5ec0f7471622b391eb28f</url>
  <id>a24f1e58ddb3c0ef14d5ec0f7471622b391eb28f</id>
  <committed-date>2009-04-08T15:22:16-07:00</committed-date>
  <authored-date>2009-03-20T09:01:42-07:00</authored-date>
  <message>Changed branch pushing from merging to push -f.

Signed-off-by: Alan Harper &lt;alan@aussiegeek.net&gt;</message>
  <tree>7913068fbe5aec8eb68ffdb81fad4a2698b0a82f</tree>
  <committer>
    <name>Alan Harper</name>
    <email>alan@aussiegeek.net</email>
  </committer>
</commit>
