← Back to context

Comment by dietr1ch

13 hours ago

I just tried 2hrs and it only uses 375M

    git clone \
        --single-branch \
        --shallow-since '-2 hours' \
        --origin 'upstream' \
        gh:NixOS/nixpkgs

What's annoying later is that you MUST remember to always use shallow fetch and hard resets into upstream/$BRANCH

    git fetch \
       --shallow-since '-2 hours' \
       upstream \
       master nixos-unstable

I have a non-shallow clone and the .git directory is less than 3GB.

  • Oh, maybe I had a full clone on my laptop before I started doing shallow fetches, but since fetching takes quite a while I've been using a shallow clone on my workstation.