CLI for automating Git process flows (Written in Ruby)
Git 'Er Done is a ruby tool for automating common git operations. It's similar in concept to git flow (https://github.com/nvie/gitflow) but is designed for small teams. It's branching model is quite a bit simpler but still makes it easy to keep an organized Git repository.
This project exists for a few reasons:
gem install git_er_done
This makes the gd
command available on your system. In 0.5.1, I have added some other alias commands gi
and gti
just to try them out for style.
When you work locally, it's helpful to work in a feature branch. To create a feature branch, you would normally do something like:
git checkout -b features/new_widget
With GitErDone, you can type the following to get the same thing:
$ gd feature new_widget
Really, the only benefit from this is prefixing branches with features/, which provides some context to your branch names. (Later, we might add bugs/ and/or 'remote-features')
After you are done with your feature, you might want to do a few things:
That's a lot of commands to remember and type. Instead, you can do:
gd done
This will trigger an interactive rebase including all changes made since master. You can choose to squash them (or not). Then it will merge your changes with master, and delete your branch.
Pretty simple.
Unless you are working by yourself, its likely you may start a feature and before you can merge and push your changes, somebody is going to push changes. It's going to be a lot easier to reconcile your changes sooner than later. With GitErDone, you can do the following when working in your feature branch.
(features/new_widget)$ gd sync
This will do the following:
Syncing frequently will help avoid nasty merges later.
Command reference:
gd - Lists all available commands.
gd help <command> - Get help for a specific command.
gd feature new_widget - Creates a new feature branch with the name 'new_widget'.
gd done new_widget - Completes a feature branch with the name 'new_widget' (Commit, squash, merge and delete branch).
gd done - Completes the current feature branch you are on.
gd squash - Condenses multiple commits for the current branch into a single commit.
gd sync - Brings your branch up to date with the latest version (Use before finishing a feature)
gd inception - Determines the original branch(es) your current commit came from.
Here's what I want to be able to support