Skip to content

Instantly share code, notes, and snippets.

@AttilaGal
Last active October 20, 2017 07:39
Show Gist options
  • Save AttilaGal/a4c19460721cbe632c75edccfa7f4b8e to your computer and use it in GitHub Desktop.
Save AttilaGal/a4c19460721cbe632c75edccfa7f4b8e to your computer and use it in GitHub Desktop.
this command removes all local branches which have already been merged into a main branch
git branch --merged | egrep -v "(^\*|master|development|test)" | xargs git branch -d
extra info found here: https://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment