Skip to content

Instantly share code, notes, and snippets.

@timc13
Forked from schacon/gist:942899
Last active January 19, 2017 23:15
Show Gist options
  • Save timc13/e44f929a95abc999f95de62d38b6777e to your computer and use it in GitHub Desktop.
Save timc13/e44f929a95abc999f95de62d38b6777e to your computer and use it in GitHub Desktop.
delete all remote branches that have already been merged into master
$ git fetch --prune;
$ git branch --remote --merged |
grep origin |
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