Git: Prune local branches that no longer exist on remote repository
The snippet can be accessed without any authentication.
Authored by
David Dorchies
Copied from https://stackoverflow.com/a/17029936
git-remove-untracked.sh 145 B
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
Please register or sign in to comment