Git Aliases

We have recently switched to Git and Github for our code projects at work. Now that I’m in and out of Git all day, I’ve developed some favorite aliases.

1
2
3
4
5
6
7
[alias]
    st = status
    br = branch -a
    df = !"git diff . | mate"
    rshow = remote show origin
    pretty = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
    last = !"clear;git --no-pager log -1"

Things to note: shell commands can be aliased by adding ! before them. Piping the output of git diff into `mate` opens the diff in my favorite text editor, Textmate. Also you can chain together multiple commands using a semi-colon.