About Delete local branches that do not exist remotely. $ git fetch --all --prune; git branch --verbose | grep ": gone]" | awk '{ print $1 }' | xargs --no-tags 1 git branch --delete --force
grep "[gone]"
will match everything that as 'g','o','n','e' characters (see https://www.gnu.org/software/grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html)So
master
and other branches we probably don't want to delete will be included.