Skip to content

Instantly share code, notes, and snippets.

@tburry
Last active August 29, 2015 14:21
Show Gist options
  • Save tburry/871ca69e3213705d9ffa to your computer and use it in GitHub Desktop.
Save tburry/871ca69e3213705d9ffa to your computer and use it in GitHub Desktop.
A handy script to clean up merged git branches.
# Remove stale remote tracking branches.
git remote prune origin
# Remove stale local tracking branches.
git branch --merged | grep -v "\*" | egrep -v "master|development" | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment