Skip to content

Instantly share code, notes, and snippets.

@kenske
Created November 14, 2019 20:46
Show Gist options
  • Save kenske/d5576bace58e33df7b030ae36ad31847 to your computer and use it in GitHub Desktop.
Save kenske/d5576bace58e33df7b030ae36ad31847 to your computer and use it in GitHub Desktop.
Cleanup local branches
set -e
git checkout master
git remote prune origin
git branch -vv | grep 'origin/.*: gone]' | 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