Smarter-Git: My Rakefile of Automated Awesomeness

by Andrew

Smarter Git

I created this rakefile of git tasks back when I was working with a dev team that relied heavily on rake. My reasoning was that since I was already doing rake deploy:staging and the like all the time (they preferred Screwcap to Capistrano), I might as well do rake git:merge_and_deploy too. This works especially well with a text expander or bash alias, where you can setup rg: to expand to rake git: or rug: to become rake username:git: if you want to further namespace out these functions.

The tools I use here also work well by themselves or in their own aliases. Use this collection as a starting point for further customizing your workflow, or use as is for a quick but complete solution.

Here are the libraries I used in this rakefile:

  • Legit – Provides a handy ‘sprout’ function for new branch creation
  • Git Smart – Provides smart-merge, smart-pull, and smart-log
  • Git Extras