Skip to content

Instantly share code, notes, and snippets.

@eschaefer
Created December 7, 2016 09:18
Show Gist options
  • Save eschaefer/f6b9c95339fc73341e6032d8f01a8c9d to your computer and use it in GitHub Desktop.
Save eschaefer/f6b9c95339fc73341e6032d8f01a8c9d to your computer and use it in GitHub Desktop.
Git alias for purging old local branches no longer tracked remotely.
alias gitpurge='git branch --merged | grep -v "\*" | grep -Ev "(\*|master|develop|staging)" | xargs -n 1 git branch -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment