ianwremmel
11/1/2018 - 11:46 PM

Remove stale greenkeeper branches from the current repo

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