Skip to content

Instantly share code, notes, and snippets.

@philpennock
Created November 13, 2013 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philpennock/7441934 to your computer and use it in GitHub Desktop.
Save philpennock/7441934 to your computer and use it in GitHub Desktop.
git subcommand to work on serious cleanup and space reclamation
#!/bin/sh
SUBDIRECTORY_OK=true
[ -d /opt/local/bin ] && PATH="/opt/local/bin:$PATH"
. "$(git --exec-path)/git-sh-setup"
set -e
git fsck --full
git prune -v
git repack -a -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment