Skip to content

Instantly share code, notes, and snippets.

@theirix
Created March 3, 2016 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theirix/65d8fb4566a2dd8d41d2 to your computer and use it in GitHub Desktop.
Save theirix/65d8fb4566a2dd8d41d2 to your computer and use it in GitHub Desktop.
Clean a git working copy
#!/bin/bash
if [ -d "$1" ] ; then
cd "$1"
fi
git gc -q
git repack -q -a -d --depth=250 --window=250
git prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment