Usage of terminal is one of the best things a programmer does. It makes us feel like a little hacker playing around (at-least to me ;D ) with his cozy tool. We write little tools (when ever possible) to automate small tasks or cut the pain of typing a very long commands.

Git has the awesome feature of writing your own aliases to commands. I like it a lot and written a set of aliases that I use everyday (I call them short-codes) and I wanted to share them hoping to-be useful to others.

And it starts here ..

These are the list of aliases that I use everyday.

alias g!='git init' 
alias g.='git add .'
alias g.-file='git add'
alias gb='git branch'
alias gb-new='git checkout -b'
alias gblame='git blame'
alias gcl='git clone'
alias gc='git commit -m'
alias gcout='git checkout'
alias gd='git diff'
alias gf='git fetch'
alias gl='git log'
alias gph='git push'
alias gph-f='git push -f'
alias gpl='git pull'
alias gr='git remote'
alias gr-list='git remote -v'
alias gr-add='git remote add'
alias greset='git reset --hard'
alias grevert-head='git revert HEAD'
alias grevert='git revert'
alias gs='git status'
alias gsh='git stash'
alias gsh-a='git stash apply'
alias gsh-c='git stash clear'
alias gsh-d='git stash drop'
alias gsh-l='git stash list'
alias gsh-p='git stash pop'

If you feel they are helpful, you can create your own aliases with the above list or I have created a git repo with detailed instructions to install and use them.

Make sure to reopen your terminal to see the changes.

Update: I'd recommend beginners to learn and understand actual commands before using any tools/aliases for git.