Skip to content

Commit 7384504

Browse files
avargitster
authored andcommitted
gc docs: note "gc --aggressive" in "fast-import"
Amend the "PACKFILE OPTIMIZATION" section in "fast-import" to explain that simply running "git gc --aggressive" after a "fast-import" should properly optimize the repository. This is simpler and more effective than the existing "repack" advice (which I'm keeping as it helps explain things) because it e.g. also packs the newly imported refs. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 22d4e3b commit 7384504

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Documentation/git-fast-import.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,13 @@ deltas are suboptimal (see above) then also adding the `-f` option
13961396
to force recomputation of all deltas can significantly reduce the
13971397
final packfile size (30-50% smaller can be quite typical).
13981398

1399+
Instead of running `git repack` you can also run `git gc
1400+
--aggressive`, which will also optimize other things after an import
1401+
(e.g. pack loose refs). As noted in the "AGGRESSIVE" section in
1402+
linkgit:git-gc[1] the `--aggressive` option will find new deltas with
1403+
the `-f` option to linkgit:git-repack[1]. For the reasons elaborated
1404+
on above using `--aggressive` after a fast-import is one of the few
1405+
cases where it's known to be worthwhile.
13991406

14001407
MEMORY UTILIZATION
14011408
------------------

0 commit comments

Comments
 (0)