git-friendly is a collection of shell scripts for automating basic git workflows I find myself typing over and over again.
Frankly I think a lot of these should be git defaults, like rebasing and automatic remote tracking. But I digress…
Checkout this repository somewhere:
git clone git://github.com/jamiew/git-friendly.git ~/dev/git-friendly
Add the directory to your PATH:
export PATH=~/dev/git-friendly:$PATH
You’ll want to put that somewhere cool like ~/.bash_profile so it’s executed each time you launch a terminal.
I’d also recommend making some basic pimpings to your ~/.gitrc to add chill features like ANSI color, command shortcuts, rebase by default & more. My .gitrc is here
I literally use them in this order
- pull — stashes any local changes, pulls from remote using rebase, pops your stash, and re-bundles if necessary
- branch [newbranch] — creates a new branch both locally & remotely, with remote tracking enabled (so you can just type ‘git pull’ and not ‘git pull origin newbranch’)
- programming genius goes here… I just use vanilla ‘git commit’, ‘git status’, ‘git diff’
- merge — merges your amazing new branch back into master using rebase. Always Be Rebasing.
- push — pushes your mindblowing changes to the remote and copies a sexy URL like “http://github.com/jamiew/myrepo/compare/3f9fea…fv932” to your clipboard that you can easily share with your peers. This only works on Macs, but boy is it sweet.
Misc commands:
- prune — cleans up old remote branches & runs garbage collection
Itches initially scratched by Jamie Wilkinson (@jamiew)
Code released under an MIT license… do whatever, patches welcome!