Skip to content

Instantly share code, notes, and snippets.

@BobToninho
Created January 26, 2024 16:02
Show Gist options
  • Save BobToninho/63b2ace9bed1995f25bceee52a205c94 to your computer and use it in GitHub Desktop.
Save BobToninho/63b2ace9bed1995f25bceee52a205c94 to your computer and use it in GitHub Desktop.
# From https://stackoverflow.com/a/17029936
# git branch -d keeps us on the safe side
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment