Skip to content

Instantly share code, notes, and snippets.

@reverie
Created May 4, 2020 20:56
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 reverie/4fd9fbb6b5c6c1953ee20dc52d8d5864 to your computer and use it in GitHub Desktop.
Save reverie/4fd9fbb6b5c6c1953ee20dc52d8d5864 to your computer and use it in GitHub Desktop.
Git bash helpers
function c { git checkout $@; }
function b { git branch $@; }
alias s="git status"
alias d="git diff"
alias dc="git diff --cached"
alias dv="git diff | vim -"
alias l="git log"
alias gp="git pull"
alias gpu="git push"
alias cam="git commit -am"
alias delete-merged-local-branches="git branch --merged | grep -v master | grep -v staging | xargs git branch -d"
alias delete-merged-remote-branches="git branch -r --merged | grep -v master | grep -v staging | grep origin | sed 's/origin\///' | xargs -n 1 git push --delete origin"
function delete-branches-matching { git branch | grep "$@" | xargs git branch -D; }
alias gpickaxe="git log -p -S"
alias gcleanup="c master && gp && delete-merged-local-branches && git remote prune origin && delete-merged-remote-branches"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment