Managing large binary files with Git

后端 未结 12 1020
不思量自难忘°
不思量自难忘° 2020-11-22 05:47

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:

12条回答
  •  执念已碎
    2020-11-22 06:37

    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?

提交回复
热议问题