Git: Difference between revisions

imported>Krey
imported>Profpatsch
nixpkgs management git-gc section
Line 24: Line 24:
   };
   };
</syntaxhighlight>
</syntaxhighlight>
== Management of the <code>nixpkgs</code> git repository ==
<code>nixpkgs</code> has become a git repository of quite substantial size with > 160 000 commits (as of early 2019). This brings many unoptimized tools to their limits, leading to long waiting times on certain operations. Here we’ll collect useful info on how to manage that.
=== git ===
git itself might not perform as usual with the default settings
==== <code>git-gc</code> ====
Normal <code>git gc</code> should work as usual, but you should force a full garbage collect every half a year or so. <code>git gc --aggressive</code> is the command for that. For the author it did not work on the first try, since their laptop’s memory was too small and it went out of memory. According to [https://stackoverflow.com/a/4829883/1382925|this StackOverflow] answer it suffices to set some local repository config variables.
git config pack.windowMemory 2g
git config pack.packSizeLimit 1g
worked well on a machine with about 6–8 GB of free RAM and two processor threads, and reduced the size of the <code>nixpkgs</code> checkout from ~1.3 GB to ~0.95 GB.