iOS Dev Nugget 284 Use Shell Aliases for Git commands


Need to run a code review on your codebase? Hire me

Like most developers, I use git very often. As I'm a lazy developer, I like to shorten the commands that I use frequently, so I have set these up as aliases:

alias ga='git add'
alias gp='git add -p'
alias gs='clear && git status -s'
alias gd='git diff --color'
alias gdc='git diff --cached --color'
alias gdt='git difftool'
alias gc='git commit $1'
alias gca='git commit -a $1'
alias gb='git branch'
alias gl='git log --color'
alias glo='git log --color --pretty=oneline'
alias gt='git tag'
alias gco='git checkout $1'
alias gcp='git cherry-pick $1'
alias gdn='git diff --name-only'
alias gr='git remote'

I get heavy use out of gb, gco, and gdn.

Do you have aliases for git commands that you found particularly useful?

Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No



Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter


View archives of past issues