Created
November 21, 2016 13:04
-
-
Save jacks0n/dc317acf4e4e4a7d0d580c972740a186 to your computer and use it in GitHub Desktop.
Git maintenance commands
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
# Remove dangling commits/blobs. | |
git reflog expire --expire=now --all | |
# Verify connectivity and validity of the DB objects. | |
git fsck --full --unreachable | |
# Cleanup unused branches. | |
git remote | xargs --no-run-if-empty git remote prune | |
# Re-pack repository objects. | |
# @see https://gcc.gnu.org/ml/gcc/2007-12/msg00165.html | |
git repack -a -d --depth=250 --window=250 | |
# Garbage collection. | |
git gc --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment