git: Spring cleaning and garbage cleanup on trees and branches

After using a repository for a while, its a good idea to clean it up as it accumulates junk.

Using "du -hs" to see how large the folder was, I found that my tree was 166M.

Git gc will do the magic for us.

Cleanup unnecessary files and optimize the local repository

Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase ) and removing unreachable objects which may have been created from prior invocations of git-add.

 

Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.

So using:

git gc

and

git submodule foreach git gc

Git will go through and clean up the tree. Eventually everything was reduced down to 111M.

Other repositories were 78M and 100M. They were cleaned up to be 56M and 77M respectively.

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog