Skip to content

Instantly share code, notes, and snippets.

@jonchurch
Last active July 21, 2022 15:13
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 jonchurch/b07f59dffed2b7e09f76f538e04713b5 to your computer and use it in GitHub Desktop.
Save jonchurch/b07f59dffed2b7e09f76f538e04713b5 to your computer and use it in GitHub Desktop.
Speed up performance of large git repos

Git Perf Improvements

  • Enable git config feature.manyFiles true to opt in to a few settings to help speed up large repos. At time of writing it sets index.version=4 and core.untrackedCache=true
  • Run git gc to garbage collect unreachable objects, clean up reflog. Under the hood this runs git prune && git repack && git rerere
  • Do you have a slow startup time for new shell sessions? Many devs are using some prompt that shows git status in your prompt. After every command it will use git to check the status of your index. When git is slow in general, this will slow down your interactive shells. One quick solution is to disable that status check in your prompt. For zsh you can do that by running git config oh-my-zsh.hide-info true, add a --global flag if you want to set this option globally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment