Popular recipes tagged "hook"http://code.activestate.com/recipes/tags/hook/2015-03-10T09:36:28-07:00ActiveState Code Recipesgit pre-commit hook to reject large files using Python (Python)
2015-03-10T09:36:28-07:00Albert-Jan Roskamhttp://code.activestate.com/recipes/users/4177640/http://code.activestate.com/recipes/578883-git-pre-commit-hook-to-reject-large-files-using-py/
<p style="color: grey">
Python
recipe 578883
by <a href="/recipes/users/4177640/">Albert-Jan Roskam</a>
(<a href="/recipes/tags/git/">git</a>, <a href="/recipes/tags/hook/">hook</a>, <a href="/recipes/tags/precommit/">precommit</a>, <a href="/recipes/tags/python/">python</a>).
Revision 9.
</p>
<p>This script should be saved in the templatedir, so it ends up in .git/hooks whenever you do a new git init.
By default, commits that contain files larger than 5 Mb are blocked. This is useful for preventing accidental large commits that are not caught by .gitignore. You can easily bypass the hook by specifing "--no-verify" with git commit. (in a previous version of this script, this did not work correctly)</p>