This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# Remove no longer existing remote branches. | |
git fetch --prune &> /dev/null | |
# Find all branches with a deleted remote branch. | |
branches=(${(@f)$(git branch -vv | grep ": gone]" | awk '{ print $1 }')}) | |
if [[ $#branches == 0 ]]; then | |
print -P "No pruneable local branches found." |