Limiting file size in git repository

前端 未结 11 1506
星月不相逢
星月不相逢 2020-12-02 14:55

I\'m currently thinking of changing my VCS (from subversion) to git. Is it possible to limit the file size within a commit in a git repository? For e. g. subversion there is

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 15:17

    I want to highlight another set of approaches that address this issue at the pull request stage: GitHub Actions and Apps. It doesn't stop large files from being committed into a branch, but if they're removed prior to the merge then the resulting base branch will not have the large files in history.

    There's a recently developed action that checks the added file sizes (through the GitHub API) against a user-defined reference value: lfs-warning.

    I've also personally hacked together a Probot app to screen for large file sizes in a PR (against a user-defined value), but it's much less efficient: sizeCheck

提交回复
热议问题