Created
September 1, 2021 15:39
-
-
Save pkoch/96e6a61a7a571b24b2f0e9dfcd71588b to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
for BRANCH in `git branch | grep -v '^*'`; do | |
if [ "$(git cherry origin/main $BRANCH | grep -c '^+')" -eq '0' ]; then | |
git branch -D $BRANCH | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment