Skip to content

Instantly share code, notes, and snippets.

@owen2
Created March 29, 2018 16:10
Show Gist options
  • Save owen2/e5d8b24d5015c6db286666883dba9694 to your computer and use it in GitHub Desktop.
Save owen2/e5d8b24d5015c6db286666883dba9694 to your computer and use it in GitHub Desktop.
Delete merged branches
git branch --merged | %{$_.trim()} | ? {$_ -notmatch 'master'} | %{git branch -d $_}
@owen2
Copy link
Author

owen2 commented Mar 29, 2018

Warning, this is a note mostly for me, and makes some assumptions about your workflow. Read carefully before running!

It's going to delete branches that are merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment