aboutsummaryrefslogtreecommitdiff
path: root/bin/gscr
blob: e09469fd84602a932b111b04fd65068203204df8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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