Skip to content

Instantly share code, notes, and snippets.

@safoorsafdar
Forked from Zoramite/maintenance.sh
Last active December 28, 2016 16:09
Show Gist options
  • Select an option

  • Save safoorsafdar/ec945ff2c61745499649ad629b0a43ed to your computer and use it in GitHub Desktop.

Select an option

Save safoorsafdar/ec945ff2c61745499649ad629b0a43ed to your computer and use it in GitHub Desktop.
Git Maintenance Commands
# Verifies the connectivity and validity of the objects in the database
git fsck --unreachable
# Manage reflog information
git reflog expire --expire=0 --all
# Pack unpacked objects in a repository
git repack -a -d -l
# Prune all unreachable objects from the object database
git prune
# Cleanup unnecessary files and optimize the local repository
git gc --aggressive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment