# Delete a single open branch but merged branch from production environment git push origin :remotes/origin/ #Delete all open but merged branches from production environment for i in `git branch -r --merged production | grep -v "production" | awk -F / '{print $2}'`; do git push origin :$i; done # check remaining branches count git branch -a | wc -l