To delete all merged branches locally other than ones with master and production in name git branch --merged | egrep -v "(^\*|master|production)" | xargs git branch -D To remove all docker containers docker rm $(docker ps -aq)