On Wed, Jan 26, 2011 at 10:08 PM, Marc Guenther <y...@schli.ch> wrote: > Hi, > > We have a local installation of Gitorious. As seems to be good practice with > git, I wanted to regularly run "git gc" on all our repositories, so I added a > small cronjob which does this.
Marc, First of all: there is already a script in the Gitorious distribution that does this for you, it is in script/repo_housekeeping. Gitorious already records the number of pushes to its repositories, and this script does some heuristics to find which repositories are due for a gc. Whenever a repository is gc-ed, we clear the counter which holds the push count and saves how much disk this repository takes up on disk. > And this caused our disk space to explode. We have a repository which is > about 3.5GB in size. This is cloned 10 times inside of Gitorious. Which isn't > a problem, since git uses hardlinks for clones, so the complete disk usage is > still 3.5GB. > > Turns out, that git gc --aggressive breaks these hardlinks. After running it > everywhere, the size of the repository shrank down to 2.2 GB, but now I have > 10 copies of them. So the situation is actually worse than before. The script I mentioned above will use the Repository class's gc! method, which will call out to Git for you. I suppose a repack will regenerate the pack files, which will probably fill up your disk - do you have any suggestions on how alternates could be used in this setting? Cheers, - Marius -- To post to this group, send email to gitorious@googlegroups.com To unsubscribe from this group, send email to gitorious+unsubscr...@googlegroups.com