Skip to content

Instantly share code, notes, and snippets.

@baldwindavid
Created August 1, 2012 18:47
Show Gist options
  • Save baldwindavid/3229724 to your computer and use it in GitHub Desktop.
Save baldwindavid/3229724 to your computer and use it in GitHub Desktop.
Git aliases
alias g="git"
# Log
alias gl="gitx"
# Commit: Prepare Commit in Gitx (run gitx first to refresh)
alias gc="gitx; gitx -c"
# Checkout branch
alias gco="g checkout"
# List all branches
alias gb="g branch -a"
# Blame: Open Source Tree
alias gbl="stree ."
# New Branch
alias gb+="g checkout -b"
# Delete Branch
alias gb-="g branch -d"
# Diff: Stage/Unstaged Changes in Gitx
alias gd="g diff HEAD | gitx"
# Status
alias gs="g status"
# Stash
alias gs+="g stash"
# Stash: Pop
alias gs-="g stash pop"
# Stash: List
alias gsl="g stash list"
# Pull
alias gp="g pull"
# Merge
alias gm="g merge"
# Undo Commit & #
alias gu1="g reset HEAD^"
alias gu2="g reset HEAD^^"
alias gu3="g reset HEAD^^^"
# Interactive Rebase - for squashing commits
alias gr2="g rebase -i HEAD~2"
alias gr3="g rebase -i HEAD~3"
alias gr4="g rebase -i HEAD~4"
alias gr5="g rebase -i HEAD~5"
alias gr6="g rebase -i HEAD~6"
alias gr7="g rebase -i HEAD~7"
alias gr8="g rebase -i HEAD~8"
alias gr9="g rebase -i HEAD~9"
alias gr10="g rebase -i HEAD~10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment