Created
June 17, 2014 20:09
-
-
Save andreyserdjuk/43742da9919fa6a8d5f0 to your computer and use it in GitHub Desktop.
git remove cached objects
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 -ev | |
git remote rm origin || true | |
git branch -D in || true | |
( | |
cd .git | |
rm -rf refs/remotes/ refs/original/ *_HEAD logs/ | |
) | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n1 --no-run-if-empty git update-ref -d | |
git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment