Skip to content

Instantly share code, notes, and snippets.

@mrsweaters
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save mrsweaters/ae3db2783f6be7ee600b to your computer and use it in GitHub Desktop.

Select an option

Save mrsweaters/ae3db2783f6be7ee600b to your computer and use it in GitHub Desktop.
delete all local branches
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
or
git branch --merged master | grep -v 'master$' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment