Skip to content

Instantly share code, notes, and snippets.

View campolloram's full-sized avatar
:shipit:
Focusing

Guillermo Campollo Ramirez campolloram

:shipit:
Focusing
View GitHub Profile
@campolloram
campolloram / git-pre-commit-hook-django
Last active July 14, 2022 13:05 — forked from mlorant/git-pre-commit-hook-django
Django - Avoid duplicate in migration names before committing changes in Git
#!/usr/bin/python
"""
Pre-commit hook for git written in Python.
Check if there is any migration number used more than one in each
migrations folder of South or Django >= 1.7.
You can install this pre-hook by executing the command:
ln -s ./git-pre-commit-hook .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Or by calling the current script or check_migrations_files() in your
own file.