Skip to content

Instantly share code, notes, and snippets.

@hubgit
Forked from lancerushing/gist:4062845
Last active December 17, 2015 13:39
Show Gist options
  • Save hubgit/5619168 to your computer and use it in GitHub Desktop.
Save hubgit/5619168 to your computer and use it in GitHub Desktop.
Delete remote branches in "origin" that have been merged into origin/master
#!/bin/bash
git branch -r --merged origin/master | \
grep origin | \
grep -v '>' | \
grep -v master | \
cut -d "/" -f 2- | \
xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment