aboutsummaryrefslogblamecommitdiff
path: root/bin/gscr
blob: 4f7e469c9597446d5c5dbd282afecfd04f664e20 (plain) (tree)
1
2
3
4
5
6
7
8
9

                        
                           

                
                                

              
                                     

              


                                           
      
#!/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