diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-01 10:19:41 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-01 10:20:22 +1200 |
commit | 3f53e69552a0780bf7783d2b6bb9f5ad456cf491 (patch) | |
tree | f637d76ace065bb445e551cc9c7d2362dcaec42e /bin/gscr | |
parent | Update submodules (diff) | |
download | dotfiles-3f53e69552a0780bf7783d2b6bb9f5ad456cf491.tar.gz dotfiles-3f53e69552a0780bf7783d2b6bb9f5ad456cf491.zip |
Add gscr(1), fgscr(1)
Diffstat (limited to 'bin/gscr')
-rwxr-xr-x | bin/gscr | 15 |
1 files changed, 15 insertions, 0 deletions
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 |