Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davoam/f32439d2bd786e6a994fe43be4db6b85 to your computer and use it in GitHub Desktop.
Save davoam/f32439d2bd786e6a994fe43be4db6b85 to your computer and use it in GitHub Desktop.
git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
@davoam
Copy link
Author

davoam commented Oct 30, 2017

@Flamefire
Copy link

Flamefire commented Feb 13, 2022

Minor modification to work across locales:

git fetch -p && for branch in `LC_ALL=C git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment