delete all local branches, which not exist remotely git fetch --prune && git branch -vv \ | grep ': gone]' \ | awk '{print $1}' \ | xargs -r git branch -D