Skip to content

Instantly share code, notes, and snippets.

@kevinsimper
Created September 3, 2015 09:25
Show Gist options
  • Save kevinsimper/bba72c5431e3ebce9f62 to your computer and use it in GitHub Desktop.
Save kevinsimper/bba72c5431e3ebce9f62 to your computer and use it in GitHub Desktop.
Delete already merged remote branches easily
git branch -r --merged | \
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | \
xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment