git-prune-merged
change
commit 31f024f5b87f07bcb9732a2380b335b42a2d295f
author Alpha Chen <alpha.chen@brilliant.org>
date
parent 27c7f9c8
diff --git a/bin/git-prune-merged b/bin/git-prune-merged
new file mode 100755
index 00000000..8013c25e
--- /dev/null
+++ b/bin/git-prune-merged
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+if [[ "${TRACE-0}" == "1" ]]; then
+    set -o xtrace
+fi
+
+# cd "$(dirname "$0")"
+
+main() {
+  # https://stackoverflow.com/a/6127884
+  git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d
+}
+
+main "$@"
+
+# vim: ft=sh
+