Skip to content

Instantly share code, notes, and snippets.

@ianwremmel
Created November 1, 2018 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianwremmel/22670f3dbe659ff998c780f1dac1ed35 to your computer and use it in GitHub Desktop.
Save ianwremmel/22670f3dbe659ff998c780f1dac1ed35 to your computer and use it in GitHub Desktop.
Remove stale greenkeeper branches from the current repo
#!/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