Skip to content

Git Hook script to prevent large binary blobs being checked in

It has already occurred in the past in testsuite.git repo, that executables were checked in by accident, and caused the Git history to get bloated.

In order to avoid such accidents in the future a Git hook script in the style of this might be useful, but taking also into account the size, and/or possibly with a magic safeword to be put in the commit message, to override the check for a single commit, if the author really knows what (s)he's doing.

Trac metadata
Trac field Value
Version
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Trac & Git
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information