Skip to content

Instantly share code, notes, and snippets.

@derekgottlieb
Created April 3, 2017 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derekgottlieb/1f3772b337fa3b1c5b009cd1de46360f to your computer and use it in GitHub Desktop.
Save derekgottlieb/1f3772b337fa3b1c5b009cd1de46360f to your computer and use it in GitHub Desktop.
git-prunelocal
#!/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