Improving Git Usage with Aliases

If you use Git regularly (which you should be!), you might get tired of typing the same commands over and over again. This is a perfect opportunity for shell aliases.

I have aliases for the most common Git operations that I use. For commands that I use less frequently, it's not a big deal to type them in full.

Using an alias like gpo instead of git push origin saves a bunch of keystrokes.

Here are the aliases I have included in my .zshrc:

# ------------------------------------- *
# Git Aliases
# ------------------------------------- *
alias gs="git status"  
alias gcam="git commit -am"  
alias gaa="git add -A"  
alias gcm="git commit -m"  
alias gf="git fetch"  
alias gfo="git fetch origin"  
alias gp="git push"  
alias gpo="git push origin"  
alias grh="git reset --hard"  
alias gd="git diff"