aboutsummaryrefslogtreecommitdiff
path: root/bin/gscr
blob: 4f7e469c9597446d5c5dbd282afecfd04f664e20 (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" || exit
            ;;
        *)
            cd -- "$arg"/.git || exit
            ;;
    esac
    git fsck || exit
    git reflog expire --expire=now || exit
    git gc --prune=now --aggressive || exit
) done