Skip to content

Commit

Permalink
Make feature-start setup tracking branch on remote
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danielbeardsley committed Mar 9, 2012
1 parent 8fe5bdf commit dda8012
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions feature.rb
Expand Up @@ -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}"

Expand Down

0 comments on commit dda8012

Please sign in to comment.