Expand description
The file that makes every future clone slower — caught while it is
still one git rm --cached away.
Git history never forgets a megabyte: an accidentally committed dataset, bundle, or core dump is paid for by every clone, forever, even after it is deleted — deletion adds a commit, it does not remove the bytes. And the hosting side has hard opinions: GitHub warns at 50 MB and refuses files over 100 MB outright, so the block threshold here is not policy invented by a hook, it is the push failing later with a worse error.
Two thresholds, both in megabytes and both configurable:
greengate.largeFileWarn(default 10) — named, never blocking: a large asset can be deliberate, and the warning is the moment to decide;greengate.largeFileBlock(default 100, GitHub’s refusal line) — blocks, with the remedy named (git-lfs, or keep it out of history).
Under the staged-only hold the working tree IS the commit’s content, so file sizes on disk are the sizes being committed.
Constants§
- NAME
- The check’s own short name, and the
checkfield of every finding it makes.
Functions§
- scan
- A finding for one file’s SIZE, or none if it is within both thresholds.
- staged
- thresholds
- The two thresholds, in bytes, as configured here.