]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gc docs: note "gc --aggressive" in "fast-import"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 7 Apr 2019 19:52:15 +0000 (21:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Apr 2019 08:01:09 +0000 (17:01 +0900)
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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.txt

index 43ab3b1637b50462ff62aa9c33c87184ef8ebc47..2248755cb7cff490e0f4a64a6037e6f9d09d2790 100644 (file)
@@ -1396,6 +1396,13 @@ deltas are suboptimal (see above) then also adding the `-f` option
 to force recomputation of all deltas can significantly reduce the
 final packfile size (30-50% smaller can be quite typical).
 
+Instead of running `git repack` you can also run `git gc
+--aggressive`, which will also optimize other things after an import
+(e.g. pack loose refs). As noted in the "AGGRESSIVE" section in
+linkgit:git-gc[1] the `--aggressive` option will find new deltas with
+the `-f` option to linkgit:git-repack[1]. For the reasons elaborated
+on above using `--aggressive` after a fast-import is one of the few
+cases where it's known to be worthwhile.
 
 MEMORY UTILIZATION
 ------------------