Skip to content

Instantly share code, notes, and snippets.

@jmikkola
Created March 3, 2020 15:24
Show Gist options
  • Save jmikkola/3e7bc590129aa4989db87f24781ac09c to your computer and use it in GitHub Desktop.
Save jmikkola/3e7bc590129aa4989db87f24781ac09c to your computer and use it in GitHub Desktop.
#!/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