new script for cleaning up old garbage from an active git repo clone.
[feisty_meow.git] / scripts / rev_control / compact_git.sh
diff --git a/scripts/rev_control/compact_git.sh b/scripts/rev_control/compact_git.sh
new file mode 100644 (file)
index 0000000..abc626a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+prune_dir="$1"
+if [ -z "$prune_dir" ]; then
+  prune_dir="$(pwd)"
+fi
+pushd "$prune_dir"
+echo cleaning git in directory $(pwd)
+git fsck --full
+git gc --prune=today --aggressive
+git repack
+popd