On Tuesday, August 28, 2012 at 19:44 EDT,
Will DeBerry <
willd...@gmail.com> wrote:
> Couldn't find any answers anywhere else so figured I would turn here.
> Was wondering if there was anyway to reduce the size of gerrit at all?
I assume you mean the size of the Git repositories managed by Gerrit.
> Maybe some way to clean it up.
That's what "git gc" is for, and you should run it with sufficient
frequency (depending on how active the gits are) to avoid performance
degrades and keep the repository size down.
> Our projects have branches on them that aren't being used anymore, so
> I started removing the branches but realized that this isn't helping
> as well as I thought it would. Basically our disk space is double of
> what it should be, so just looking for some help.
Why are the gits so big? Are you checking in huge amounts of binaries?
How big is big? The "why so big" is important as it affects the options.
Deleting branches will only make a noticeable difference if the commits
on the deleted branches refer to files that aren't used elsewhere. If
you've merged branch A into branch B and delete branch A, you won't save
anything.
Assuming the objects you want to get rid of truly are unreferenced, "git
gc" will get rid of them. However, Git will keep around unreachable
objects for a while after their creation (two weeks by default, I
think), but that can be changed with the --prune option. Also, the
commits better not be referenced in the reflog -- that's another safety
mechanism to avoid data loss.
--
Magnus Bäck
ba...@google.com