git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Please consider extending .gitignore to support setting of a file size limit

From
RMRoger Mendes <sproger1@gmail.com>
Date
May 7, 2015, 21:14 UTC
Message-ID
<CAC+AdWRpJnt2PN1YcB7VoHcKsO86_DhE1mOB5Ls9bWaEd_XKXQ@mail.gmail.com>

Allow .gitignore to support setting a file size limit so that all files over a certain size will by automatically ignored when performing git add, commit -a...; Exclusions to this size limit for files can be allowed by specifying exceptions '!' syntax that already exists. It probably should be considered to have a default limit already built into git of say 100MB (used by github) which can be changed in the .gitignore file.

This would avoid accidental commits of large files which are known to be poorly supported.

This seems like a fairly simple feature to add, I'm not sure why no one has done this or thought of it given the number of complaints, questions... with large file handling.

We can ignore by file name attribute, why not by file size?

Yes, I know I can add pre-commit scripts... to workaround this issue, but there should be a better way (or maybe I'm missing something?).

Accidental commits of large files is a common mistake, and often results in the commit taking an extremely long time to process and sometimes if you kill the process, then you end up with corrupt git repo (at least in jgit, which is used by Netbeans).

IMHO this would be a very useful feature.
Next: Junio C Hamano
Message 1 of 7 in “Please consider extending .gitignore to support setting of a file size limit”
  1. Roger MendesMay 7, 2015
  2. Junio C HamanoMay 7, 2015
  3. Thomas KochMay 8, 2015
  4. Kevin DaudtMay 8, 2015
  5. Fredrik GustafssonMay 8, 2015
  6. Stefan BellerMay 8, 2015
  7. Philip OakleyMay 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.