Last active
January 23, 2020 09:06
-
-
Save john20xdoe/422439c3a5d9c66e7c526736cc02cada to your computer and use it in GitHub Desktop.
Git Repo Compression
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
$ 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