Created
November 1, 2018 23:46
-
-
Save ianwremmel/22670f3dbe659ff998c780f1dac1ed35 to your computer and use it in GitHub Desktop.
Remove stale greenkeeper branches from the current repo
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 bash | |
set -euo pipefail | |
BRANCHES=$(git branch -r | grep origin | grep greenkeeper) | |
for BRANCH in $BRANCHES; do | |
echo "Deleting $BRANCH" | |
git push origin --delete "${BRANCH//origin\//}" | |
echo "Done" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment