Skip to content

Instantly share code, notes, and snippets.

@Gonzih
Forked from schacon/gist:942899
Last active February 9, 2016 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gonzih/fbf3767765a16ce006ff to your computer and use it in GitHub Desktop.
Save Gonzih/fbf3767765a16ce006ff to your computer and use it in GitHub Desktop.
delete all remote branches that have already been merged into master
git branch -r --merged | grep origin | grep -v '>' | grep -v master | xargs -L1 | awk '{sub(/origin\//,"");print}' | xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment