This will;
- Lists all remote merged branches
- Exclude
master
branch - Exclude
stable
branch - Remove the
origin/
prefix - Push the deletion (one by one)
git branch --list --color=never --remotes --merged origin/master | \
grep -v master | \
grep -v stable | \
cut -d/ -f2- | \
xargs -n1 git push origin --delete