Skip to content

@miketaylr /pre-commit
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/bin/bash
# pre-commit hook to prevent html5 video or audio files from being checked
# into the repo. because large binary files in a git repo sucks. bad.
MEDIAFILES=$(git diff --cached --name-only --diff-filter=ACR | egrep -n .*\.\(webm\|mp4\|ogg\|mp3\|ogv\|m4v\|avi\|vp8\|mov\|oga\|mp1\|mp2\|mpeg\|3gp\|wav\)$)
if [ -z "$MEDIAFILES" ]; then
exit 0;
else
echo "Commit failed. Are you trying to check in media files into the repo?"
exit 1;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.