Created
October 11, 2015 23:19
-
-
Save keithpitty/eba5f5ae4bd2bceb991d to your computer and use it in GitHub Desktop.
Script to cleanup old local 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
#!/bin/bash | |
echo "Deleting the following branches that have been merged into master:" | |
git branch --merge master | grep -v "\* master" | |
git branch --merge master | grep -v "\* master" | xargs -n 1 git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment