651.288.7000 info@intertech.com

A Git user needs to perform regular local repo maintenance for repo performance and its health.  Thankfully, this is very simple – yet I’m surprised at how many users are unaware of this command and the need for it.

The main command for maintenance is gc. gc optimizes and removes no-longer used data from the local repo. It is Git’s “garbage collector” and optimizer.

Typically, I occasionally run:

The –aggressive option causes it to run longer, but does a much more thorough job. Depending on your local repo size and computer performance, it might not take more than another 30 seconds to run.

There are additional configuration options for gc as well. Please consult the git gc help for further info.


Like What You've Read?

Subscribe to the Blog.

Every Friday we send that week's content from our Developers via email. Try it out!

Some ad blockers can block the form below.

You have Successfully Subscribed!

Pin It on Pinterest

Share This