Skip to content

Instantly share code, notes, and snippets.

@vojtatranta
Created April 21, 2016 11:23
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 vojtatranta/7512f625321e85ff92b260a41d908984 to your computer and use it in GitHub Desktop.
Save vojtatranta/7512f625321e85ff92b260a41d908984 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Task delete merged local and remote branches
#
EXCLUDE="master|next|release"
# local
git branch --merged remotes/origin/next | grep -v -E "$EXCLUDE" | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment