Skip to content

Instantly share code, notes, and snippets.

@arkiver
Last active December 29, 2016 21:06
Show Gist options
  • Save arkiver/b2d0b1da43c48a2800ea to your computer and use it in GitHub Desktop.
Save arkiver/b2d0b1da43c48a2800ea to your computer and use it in GitHub Desktop.
# Destructive! Use carefully.
# merged branches
((`git branch --merge master`).strip!.split(' ') - ['master', 'release']).map{ |b| `git branch -D "#{b}"; git push origin :"#{b}"` }
# All local branches
((`git branch`).strip!.split(' ') - ['master', 'release', 'development']).map{ |b| `git branch -D "#{b}"; git push origin :"#{b}"` }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment