I am running a git gc --aggressive
on a very large repo (apx 100 gb). It's been running since two nights ago, and as of a couple hours, it has been stuck on: "Compressing Objects: 99% (76496/76777)"
If I Ctrl-C the process, what are the consequences? Will my repo be unusable? My intuition says no, but I'd like some opinions. Thanks!
FWIW, I just corrupted a repository by aborting
git gc
with CTRL+C.git fsck
now shows the following errors:And quite a few
I'm not going to investigate on this, but I would like to point out that I'm going to avoid aborting
git gc
.git is supposed to be always safe from interruptions like this. If you are worried, though, I suggest Ctrl+Z and then run a
git fsck --full
to make sure the system is consistent.There are a number of git-config variables which might help your git-gc go faster. I use the following on one particular large repo, but there are many more options to randomly try (or carefully study, whichever).
These only help if your problem is that you are running out of memory.
Note: there is an interesting evolution for git 2.0 (Q2 2014):
This is described in commit 125f814, done by Nguyễn Thái Ngọc Duy (
pclouds
):That could help avoiding the "freeze" issue you have when running that command on large repos.