I am looking for opinions of how to handle large binary files on which my source code (web application) is dependent. We are currently discussing several alternatives:
git clone --filter
from Git 2.19 + shallow clones
This new option might eventually become the final solution to the binary file problem, if the Git and GitHub devs and make it user friendly enough (which they arguably still haven't achieved for submodules for example).
It allows to actually only fetch files and directories that you want for the server, and was introduced together with a remote protocol extension.
With this, we could first do a shallow clone, and then automate which blobs to fetch with the build system for each type of build.
There is even already a --filter=blob:limit
which allows limiting the maximum blob size to fetch.
I have provided a minimal detailed example of how the feature looks like at: How do I clone a subdirectory only of a Git repository?