Skip to content

Instantly share code, notes, and snippets.

@rafecolton
Last active December 22, 2015 22:19
Show Gist options
  • Save rafecolton/6539525 to your computer and use it in GitHub Desktop.
Save rafecolton/6539525 to your computer and use it in GitHub Desktop.
git tidy - cleans up your remote and local branches
[alias]
tidy = "!git remote prune origin 2>/dev/null; echo \"$(git branch -vv | grep origin | tr '[]*?+' ' ')\" | egrep -v \"$(git branch -r | awk '{print $1}')\" | awk '{print $1}' | xargs git branch -d 2>/dev/null"
refresh = "!git checkout master && git fetch && git pull --rebase && git tidy"
t = "!git tidy"
r = "!git refresh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment