My Dot Files: Dot Aliases
This is the first part of a series in which I'll document the various dotfiles I use to support my work, making it easier and more enjoyable.
I use Git and Rails every day at work. To stop my fingers wearing down I've created short aliases for the most common tasks I need to do.
Stick these in ~/.aliases.
# ~/.aliases
# Record how much I've used various Git commands:
# http://github.com/icefox/git-achievements
alias git="git-achievements"
# Working with Git
alias g='git'
alias gs='git status'
alias gc='git commit'
alias gca='git commit -a'
alias ga='git add'
alias gco='git checkout'
alias gb='git branch'
alias gm='git merge'
alias gd="git diff"
# Working with Rails
alias s='script/server'
alias c='script/console'
alias m='rake db:migrate'
alias r='rake'
# Open the current directory in TextMate
alias e='mate .'
# Serve the contents of the current directory over HTTP
alias serve="ruby -rwebrick -e\"s = WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start\""
Now source the aliases file from your ~/.profile to use them.
# ~/.profile
for I in aliases; do
[ -f ~/.$I ] && . ~/.$I
done
Disagree? Found a typo? Got a question? Email me at craig@barkingiguana.com.