new script for cleaning up old garbage from an active git repo clone.
authorChris Koeritz <fred@gruntose.com>
Wed, 6 Feb 2013 16:54:25 +0000 (11:54 -0500)
committerChris Koeritz <fred@gruntose.com>
Wed, 6 Feb 2013 16:54:25 +0000 (11:54 -0500)
scripts/rev_control/compact_git.sh [new file with mode: 0644]

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