How to declutter your Quarto repo with Git submodules

Stop stuffing your Quarto repo with figure files like an overpacked suitcase... If you're storing generated figures in your Quarto project's main repository, you're creating a mess. Slow clones, bloated repos, unhappy teammates. Git submodules = lean main repo + organized assets + happy developers See it working in Quarto projects: 📂 Main repo: https://lnkd.in/gUtitFyW 🖼️ Figures repo: https://lnkd.in/gHViUFCH Implementation guide: https://lnkd.in/gzgf3tMg #quarto #git #submodules

  • Comparison diagram showing two repository structures side by side. Left side labeled 'Regular Repository' displays a file tree with _quarto.yml, posts/ folder, and figures/ folder containing plot1.png (1.8 MB), plot2.png (2.1 MB), and plot3.png (1.3 MB), totaling 5.2 MB in figures. Repository size shows ~5.5 MB in red with note 'Grows with every figure.' Right side labeled 'Main Repository' shows the same _quarto.yml and posts/ folder, but figures appears as 'figures @ a1b2c3' (a git reference link), with repository size of ~50 KB in green. Below is an orange-bordered box labeled 'Figures Submodule' containing 'All figures (5.2 MB)' and 'Separate repository' in gray text, illustrating how git submodules keep the main repository lightweight while storing figures separately.

I would question the size of those images. I'd give it a go to use something like https://squoosh.app/ (which can be installed as a PWA and used locally) to turn those megabytes into kilobytes. Also, if you move things to the submodule, then aren't you eventually cloning the whole thing anyways? Unless you don't look at the images at all during report creation, I don't see how that would benefit the case.

To view or add a comment, sign in

Explore content categories