4

I recently split a git repo...

Project
    ProjectA
    ProjectB
    ProjectC

...into 3 repos...

ProjectA
ProjectB
ProjectC

...using the following guide:

Detach (move) subdirectory into separate Git repository

The size of the original repo (.git directory) was 3.7GB. The project contains a lot of .psd files.

The problem is that one of the new repos (ProjectC) is now 5.9GB (.git folder). Clearly there was some compression and/or diffing that was happening that is no longer happening.

I tried repacking and compressing using:

git repack -a -d --depth=250 --window=250

Based on information found on this page:

http://metalinguist.wordpress.com/2007/12/06/the-woes-of-git-gc-aggressive-and-how-git-deltas-work/

The size of the repo did not change. Is there a way to get the repo to completely re-compress and re-diff everything? Am I just doing something wrong?

The three original projects didn't share any files, so I doubt there was much diff gain from being able to diff across three projects vs one.

I'm not short of disk space, so this is largely just an educational exercise... plus it's driving me nuts.

Community
  • 1
  • 1
Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58
  • Can you show the output of `git count-objects -v` in each new repository? – CB Bailey Jul 19 '12 at 05:58
  • Would http://stackoverflow.com/questions/9040083/error-when-pulling-warning-suboptimal-pack-out-of-memory/9041551#9041551 and http://stackoverflow.com/questions/2882375/how-to-really-delete-a-git-branch-i-e-remove-all-of-its-objects-commits/2882485#2882485 help? – VonC Jul 19 '12 at 06:46

1 Answers1

3

OK, I'm going to answer my own question. I just ran across this:

git gc --aggressive --prune=1day

I'd run git gc --aggressive on the repo with no real change in size, but adding the --prune=1day made all the difference. The repo is now down to 1.9G.

Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58
  • It is ok, and even encouraged to answer one's own questions. – Trufa Jul 19 '12 at 07:03
  • If you're talking about accepting the answer, I can't do that for another day. Not sure why SO puts that restriction on people. I guess to keep them from gaming it. – Roger Gilbrat Jul 20 '12 at 01:45