aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fgscr4
-rwxr-xr-xbin/gscr15
2 files changed, 19 insertions, 0 deletions
diff --git a/bin/fgscr b/bin/fgscr
new file mode 100755
index 00000000..2a50cc20
--- /dev/null
+++ b/bin/fgscr
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Find all the Git repositories in a directory and scrub them all
+hash gscr || exit
+find "${@:-.}" -name '.git' -exec gscr {} +
diff --git a/bin/gscr b/bin/gscr
new file mode 100755
index 00000000..b96da8d7
--- /dev/null
+++ b/bin/gscr
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Scrub a Git repository
+for arg in "${@:?}" ; do
+ case $arg in
+ *.git)
+ cd -- "$arg" || continue
+ ;;
+ *)
+ cd -- "$arg"/.git || continue
+ ;;
+ esac
+ git fsck || continue
+ git reflog expire --expire=now || continue
+ git gc --prune=now --aggressive || continue
+done