Skip to content

Instantly share code, notes, and snippets.

@boopathi
Last active January 13, 2018 20:37
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 boopathi/3c16a28e818f5ed5a82277ecf6581965 to your computer and use it in GitHub Desktop.
Save boopathi/3c16a28e818f5ed5a82277ecf6581965 to your computer and use it in GitHub Desktop.
Cleanup git branches
#!/bin/bash
git branch -r |
awk '{print $1}' |
egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) |
awk '{print $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment