Limiting file size in git repository

前端 未结 11 1477
星月不相逢
星月不相逢 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:00

    if you are using gitolite you can also try VREF. There is one VREF already provided by default (the code is in gitolite/src/VREF/MAX_NEWBIN_SIZE). It is called MAX_NEWBIN_SIZE. It works like this:

    repo name
    RW+     =   username
    -   VREF/MAX_NEWBIN_SIZE/1000   =   usernames 
    

    Where 1000 is example threshold in Bytes.

    This VREF works like a update hook and it will reject your push if one file you are to push is greater than the threshold.

提交回复
热议问题