Local git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d Remote git branch -r --merged | grep -v master | sed 's/origin\//:/' | xargs -n 1 git push origin