Łukasz Wieczorek's blog A slice of programmer's life

Cleaning up old remote branches in Git

This time in fish.

git fetch origin --prune
git fetch --all
for branch in (git branch --remote | egrep -v 'develop|master|\*' | tr -d ' ' | sed 's/origin\///'); git push origin ":$branch"; end