Skip to content

Instantly share code, notes, and snippets.

@mslabko
Last active July 14, 2016 08:03
Show Gist options
  • Save mslabko/197c23d14ef62700751b to your computer and use it in GitHub Desktop.
Save mslabko/197c23d14ef62700751b to your computer and use it in GitHub Desktop.
Mass delete branches from repo which already included in mainline
by @kandy
git branch -a --merged mainline/develop|grep 'remotes/origin/'|grep -v 'master'|grep -v 'develop'|sed 's/ remotes\/origin\///' |xargs -n1 -I % git push origin :%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment