Last active
August 29, 2015 14:21
-
-
Save tburry/871ca69e3213705d9ffa to your computer and use it in GitHub Desktop.
A handy script to clean up merged git branches.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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