Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Add some smarts to your git workflow

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


git-smart logo

Adds some additional git commands to add some smarts to your workflow. These commands follow a few guidelines:

  1. It should do the 'right thing' in all situations - an inexperienced git user should be guided away from making simple mistakes.
  2. It should make every attempt to explain to the user what decisions it has made, and why.
  3. All git commands that modify the repository should be shown to the user - hopefully this helps the user eventually learn the underlying git commands, and when they're relevant.
  4. All git commands, destructive or not, and their output should be shown to the user with the -v/--verbose flag. (not implemented yet)


All you need to do is grab the gem:

gem install git-smart

That'll put an executable file for each command as a gem executable. They can be removed by uninstalling the gem.

You almost certainly want to run this as well, to allow git commands to be output with colour:

git config --global color.ui always

Git normally only colours output when being run from the terminal, not from within scripts like these. This sorts that right out.


Git allows custom commands with a simple convention - git xyz tries to find an executable git-xyz on the path. So, to run the commands, simply type

git smart-pull
git smart-merge <branchname>


The code for each of these commands has been annotated with comments and rendered with Rocco:

Contributing to git-smart

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Copyright (c) 2011 Glen Maddern. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.