This file contains 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 bash | |
# first we prune origin to ensure our local list of remote branches is up to date | |
git remote prune origin | |
GONE_BRANCHES=$(git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}') | |
if [ -z "$GONE_BRANCHES" ]; then | |
echo "Could not find any local branches that have a gone remote" | |
exit 0 |