git gc on machine with quota
Asked Answered
W

3

6

Simple question, I'm trying to run git gc on a machine with a quota. Pre-gc, I'm at about 18GB of usage, almost all of which is my cloned git repository. My disk limit is 25GB. During the git gc operation, enough temporary files are written to disk to hit my limit and thus cause the git gc operation to fail.

I can delete the .git/objects/pack/tmp_pack_* after the failed operation and get back down to 18GB of usage, but I'd really like to actually complete git gc and reclaim a little performance.

Is there some fancy option (or series of other git commands) that I can use that doesn't involve first writing >7GB of temporary files to the disk?

Warchaw answered 4/12, 2009 at 22:6 Comment(1)
What version of git are you running?Pericycle
M
2

Which part of the gc is important for you? You could try running the git-prune and git-repack parts separately. With git-prune, be sure and specify a cutoff date with the --expire option. If there are a ton of loose objects in your repo, getting them out of the way first would be helpful.*

With git-repack, you can perhaps mess with the depth and window settings to get something small enough to run within the space you have.

* I don't pretend to fully understand all the issues involved, but I do notice that the prune comes after the repack in the git-gc code.

Maggard answered 5/12, 2009 at 0:49 Comment(0)
W
0

Looks like the best solution is to ask IT for a bigger quota, though I'm still interested to hear workarounds. Today they were feeling generous, but tomorrow... :)

Warchaw answered 5/12, 2009 at 0:21 Comment(0)
O
-1

git prune is an excellent suggestion, good call Jefromi.

Another thing you can do is compress your other files ; git gc; decompress.

7z gets amazing compression, but won't preserve hardlinks and Unix owner/group, IIRC. If you have a quota, the files are probably all owned by your account, so no worries on the first score. But the safest is tar c --lzma if you have it, or just tar czf or cjf. If you have a lot of small files, the umm, external(?) fragmentation up to block-size might be significant.

Odyl answered 5/12, 2009 at 7:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.