Skip to content

Instantly share code, notes, and snippets.

@kricha
Created July 26, 2016 08:14
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 kricha/cc8d1bf0894f18c674e3b4275bb7a5bf to your computer and use it in GitHub Desktop.
Save kricha/cc8d1bf0894f18c674e3b4275bb7a5bf to your computer and use it in GitHub Desktop.
remove remote merged to master branches
arr=(master "->" HEAD);for branch in `git branch -r --merged master| grep -v "\* master"`; do branch=${branch#origin/}; if [[ " ${arr[@]} " =~ " ${branch} " ]];then echo "DO NOT DELETE ! " ${branch};else git branch -D ${branch}; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment