Skip to content

Instantly share code, notes, and snippets.

@DanCech
Last active May 24, 2016 15:02
Show Gist options
  • Save DanCech/e1b8cf7d0be5843c6065 to your computer and use it in GitHub Desktop.
Save DanCech/e1b8cf7d0be5843c6065 to your computer and use it in GitHub Desktop.
Git branch cleanup script
#!/bin/sh
git remote prune origin
git branch --merged | grep -v master | grep -v '[*]' | xargs -r git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment