Skip to content

Instantly share code, notes, and snippets.

@citricacid-pl
Last active April 13, 2016 10:48
Show Gist options
  • Save citricacid-pl/393c2b42831e573e5cca to your computer and use it in GitHub Desktop.
Save citricacid-pl/393c2b42831e573e5cca to your computer and use it in GitHub Desktop.
# Following would safe-delete local branches that are already merged to remote repository except branches matching regex
# In this case branches with names containing PROT-2100 or master will stay intact.
git branch -d `git branch --merged |grep -v -E "(PROT-2100)|(master)"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment