Skip to content

Instantly share code, notes, and snippets.

@wesleybliss
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesleybliss/9378153 to your computer and use it in GitHub Desktop.
Save wesleybliss/9378153 to your computer and use it in GitHub Desktop.
# GIT aliases and syntax highlights
alias gs='git status'
alias gl='git log'
alias gb='git branch'
alias gbb='git branch -al'
alias gc='git commit -am'
alias ga='git add'
alias gaa='git add -A'
alias gco='git checkout'
alias gfa='git fetch --all'
alias gm='git merge'
alias gp='git push'
alias gpo='git push origin'
alias grh='git reset --hard'
alias gcb='git rev-parse --abbrev-ref HEAD'
# Even shorter, possibly dangerous GIT aliases
alias s='git status -sb'
alias b='git branch'
alias c='git add -A && git commit -am'
alias cc='git commit -am'
alias m='git merge'
alias p='git push origin' # Default to pushing origin, since that's the most common use-case
alias f='git fetch'
alias ss='git status'
alias bv='git branch -v'
alias bb='git branch -v'
alias pp='git push' # Allow pushing to other remotes
alias fo='git fetch origin'
alias fa='git fetch --all'
alias ff='git fetch --all' # This one doesn't exactly make sense, acronymically speaking, but w/e
alias aa='git add -A'
alias co='git checkout'
alias gl='git log --oneline --decorate'
alias gll='git log'
alias cb='git rev-parse --abbrev-ref HEAD'
alias pcb='echo "Pushing current branch: `cb`"; p `cb`'
alias mcb='echo "Merging current branch: `cb`"; m origin/`cb`'
#
alias rh='git reset --hard'
#
alias gld='for k in `git branch|sed s/^..//`;do echo -e `git log -1 --pretty=format:"%C(yellow)%cr%Creset" "$k"`\\t"$k";done|sort'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment