Created
April 3, 2017 13:29
-
-
Save derekgottlieb/1f3772b337fa3b1c5b009cd1de46360f to your computer and use it in GitHub Desktop.
git-prunelocal
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 | |
# Make sure our remote branch list is up to date | |
git remote update origin --prune | |
if [[ $# = 1 && $1 == '-n' ]]; then | |
git branch -vv | grep ' gone]' | |
else | |
git branch -vv | grep ' gone]' | egrep -v '^\*' | cut -f 3 -d ' ' | xargs git branch -D | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment