GithubHelp home page GithubHelp logo

git-smart's Introduction

git-smart

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.

Installing

All you need to do is grab the gem:

gem install git-smart

This will add an executable for each command, e.g. git-smart-pull. You call them using git's simple syntax for custom commands, e.g. git smart-pull. They'll be removed when you uninstall 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.

Get smart!

There's only three commands at this point, but there'll be more!

smart-pull

Run git smart-pull whenever you would have run git pull. It doesn't take any arguments, it'll use the tracking branch configuration or assume 'origin/same-branch-name'.

In brief, it'll detect the best way to grab the changes from the server and update your local branch, using a git rebase -p if there's no easier way. It'll also stash/pop local changes if need be.

Read what it does in detail: smart-pull

Recommended alias to use: gup

smart-merge

Run git smart-merge when you would have run git merge. This is basically a wrapper around git merge --no-ff, which should have been the default anyway. It also does a stash/pop if required, and reports a bit of helpful output.

Details here: smart-merge

Recommended alias to use: gm

smart-log

Big hat tip to @ben_h for this one - it's an alias to a completely badass git log format that not many people know about.

Details here: smart-log

Recommended alias to use: gl

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

Copyright (c) 2011 Glen Maddern and Envato Pty Ltd. See LICENSE.txt for further details.

git-smart's People

Contributors

geelen avatar benhoskings avatar jkadijk avatar

Stargazers

Joey Smith avatar

Watchers

Joey Smith avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.