Created
March 3, 2020 15:24
-
-
Save jmikkola/3e7bc590129aa4989db87f24781ac09c to your computer and use it in GitHub Desktop.
This file contains 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 -e | |
function prompt() { | |
B="$1" | |
read -p 'Delete? [y/n/s] ' result | |
case "$result" in | |
y) | |
git branch -D "$B" | |
;; | |
s) | |
git show "$B" | |
prompt "$B" | |
;; | |
n) | |
echo | |
;; | |
esac | |
} | |
# This assumes that you prefix your branch names with your username | |
for B in $(git branch | grep "$USER"); do | |
git log -n 1 "$B" | |
prompt "$B" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment