git branch | grep -v "a" | grep -v "b" | grep -v "c" | xargs git branch -Dgit branch-- list all available branches.grep -v "a" | grep -v "b" | grep -v "c"-- matches all branches except a,b or c.xargs git branch -D-- excutegit branch -Dwith the result fromgrep.