summaryrefslogtreecommitdiff
path: root/src/content/en/pastebin/2022/07/14/git-cleanup.adoc
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-04-30 06:23:27 -0300
committerEuAndreh <eu@euandre.org>2025-04-30 06:33:36 -0300
commit61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da (patch)
treefc3c799bece509682b712f6e42e2816059c83c7a /src/content/en/pastebin/2022/07/14/git-cleanup.adoc
parentMakefile: No need to remove non-generated *.mo files (diff)
downloadeuandre.org-61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da.tar.gz
euandre.org-61ffa8466bbfa4ca8b13b442a3bd63ef9504a6da.tar.xz
src/content/en/: Unpluralize collection names
Diffstat (limited to 'src/content/en/pastebin/2022/07/14/git-cleanup.adoc')
-rw-r--r--src/content/en/pastebin/2022/07/14/git-cleanup.adoc59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/content/en/pastebin/2022/07/14/git-cleanup.adoc b/src/content/en/pastebin/2022/07/14/git-cleanup.adoc
new file mode 100644
index 0000000..b223f86
--- /dev/null
+++ b/src/content/en/pastebin/2022/07/14/git-cleanup.adoc
@@ -0,0 +1,59 @@
+= git-cleanup command
+
+[source,sh]
+----
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ git cleanup
+ git cleanup -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+ Options:
+ -h, --help show this message
+ EOF
+}
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+
+
+git branch --merged |
+ grep -v -e '^\*' -e '^. main$' |
+ xargs git branch -d
+----