Skip to content

Instantly share code, notes, and snippets.

View guysmoilov's full-sized avatar
🐶

Guy Smoilovsky guysmoilov

🐶
View GitHub Profile
@guysmoilov
guysmoilov / Git pre-commit hook for large files.md
Last active February 14, 2024 23:46
Git pre-commit hook for large files

Git pre-commit hook for large files

This hook warns you before you accidentally commit large files to git. It's very hard to reverse such an accidental commit, so it's better to prevent it in advance.

Since you will likely want this script to run in all your git repos, a script is attached to add this hook to all git repos you create / clone in the future.

Of course, you can just download it directly to the hooks in an existing git repo.

If you find this script useful, you might enjoy our more heavy-duty project FastDS, which aims to make it easier to work with versioning in data science projects.