Skip to content

Instantly share code, notes, and snippets.

@aikar
Created November 28, 2018 01:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aikar/dcc2704851ada2122e0631a0f84e1783 to your computer and use it in GitHub Desktop.
#!/bin/bash
pwd=`pwd`
for dir in $(find . -type d -name ".git" | sed 's/\/.git//g'); do
cd "$pwd/$dir"
git reflog expire --expire-unreachable=3d
git gc --prune=5d
git gc --aggressive
git prune
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment