Skip to content

Instantly share code, notes, and snippets.

@john20xdoe
Last active January 23, 2020 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john20xdoe/422439c3a5d9c66e7c526736cc02cada to your computer and use it in GitHub Desktop.
Save john20xdoe/422439c3a5d9c66e7c526736cc02cada to your computer and use it in GitHub Desktop.
Git Repo Compression
$ git reflog expire --expire=1.minute refs/heads/master
$ git fsck --unreachable
$ git prune
$ git gc
Reference: http://www.newartisans.com/blog/2008/04/diving-into-git.html
Basically this removes all reflogs that are older than a minute for the master branch, finds and deletes any commits that aren’t being used, then does some general cleanup on the whole repository to further compress it. This could have had its own tip, but it’s probably better to illustrate a great use of the subject’s subcommands in your workflow.
-- http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment