I have an old mercurial repository that I am exporting to git using hg-fast-export. It is 115MB. When I run hg-fast-export as described here, the resulting git repository is 663M. Any idea why that would be?
Asked
Active
Viewed 226 times
3
-
I don't know what the mercurial import script does, but try running `git gc` or `git repack` (there are a variety of options to each you may need to experiment with) to see if that shrinks things. – Andrew C Dec 04 '14 at 16:42
-
git repack said there was nothing to pack. git gc made it 100MB bigger... – Colton Leekly-Winslow Dec 04 '14 at 16:51
-
`git repack -a -d --depth=250 --window=250` is my normal repo shrinking command. Depending on what the import script did you may have extra refs and/or reflogs that need to be cleaned up first. But you can try the `repack` first. – Andrew C Dec 04 '14 at 16:54
1 Answers
3
The answer was
git gc --aggressive
which I actually got from an article where Linus Torvalds said it was a bad idea but his command didn't work and this one did.
I also had to change the memory usage parameters for packing, as described here:
Is there a way to limit the amount of memory that "git gc" uses?

Wai Ha Lee
- 8,598
- 83
- 57
- 92

Colton Leekly-Winslow
- 803
- 1
- 8
- 14