Created
April 11, 2010 07:38
-
-
Save wereHamster/362574 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# The job of git-flush is to recompactify your repository to be as small | |
# as possible, by dropping all reflogs, stashes, and other cruft that may | |
# be bloating your pack files. | |
git for-each-ref --format="%(refname)" refs/original/ | \ | |
xargs -n 1 git update-ref -d | |
git reflog expire --expire=0 --all | |
if [ "$1" = "-f" ]; then | |
git stash clear | |
fi | |
git gc --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment