From dda8012e22dcf50fa1f597ed435b5e1f0f275da1 Mon Sep 17 00:00:00 2001 From: Daniel Beardsley Date: Fri, 9 Mar 2012 14:34:12 -0700 Subject: [PATCH] Make `feature-start` setup tracking branch on remote A single `git push -u` would do the same thing, but asking each user to do that the very first time they push would be silly. And automatically pushing every time they create a feature branch would also be silly. --- feature.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feature.rb b/feature.rb index 1db377d..4e401f2 100755 --- a/feature.rb +++ b/feature.rb @@ -13,6 +13,10 @@ Git::run_safe("git branch \"#{feature}\" master") Git::run_safe("git checkout \"#{feature}\"") + # Automatically setup remote tracking branch + Git::run_safe("git config branch.#{feature}.remote origin") + Git::run_safe("git config branch.#{feature}.merge refs/heads/#{feature}") + Git::run_safe("git config branch.#{feature}.rebase true") puts "Successfully created a new feature-branch: #{feature}"