Skip to content

Instantly share code, notes, and snippets.

@UdjinM6
Forked from schacon/gist:942899
Last active August 29, 2015 14:14
Show Gist options
  • Save UdjinM6/770e126a0055803bfc91 to your computer and use it in GitHub Desktop.
Save UdjinM6/770e126a0055803bfc91 to your computer and use it in GitHub Desktop.
Remove local branches that were merged
# remove local
git branch --merged |
grep -v '>' |
grep -v master |
xargs -L1 |
cut -d"/" -f2- |
xargs git branch -d
# remove remote
git branch -r --merged |
grep -v '>' |
grep -v master |
xargs -L1 |
cut -d"/" -f2- |
xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment