Last active
April 16, 2021 05:43
-
-
Save mikeybeck/8bf751208551f31263c88e5765f9012a to your computer and use it in GitHub Desktop.
Deletes my production-merged remote git branches for a given date period (2020-08) in an extremely inefficient manner
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
| git for-each-ref --format=' %(authorname) %09 %(committerdate:short) %09 %(refname)' --sort=committerdate --sort=authorname --merged production | grep "refs/remotes/origin/" | sed 's/refs\/remotes\/origin\///g' | grep Mike | grep mikeybeck | grep 2020-08 | awk '{ print $4 }' | while read x; do echo "deleting $x"; git push origin --delete $x; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment