Search code examples
pythongitpycharmdjango-south

Pycharm, django south migration files and git integration


As you know, django south migration files are generated by command below;

# python manage.py schemamigration model_name --auto

Sometimes, I forget to add the migration files to project repository.

Is there a way to display reminder of the manually generated migration files in pycharm to add git repo before committing other project files to the repository?


Solution

  • According to pancakes's comment, I enabled pre-commit hook and append lines below:

    ud=`git status -u | grep '^Untracked files:$'`
    
    if [ -n "$ud" ];
    then 
            cat <<\EOF 
    Warning: There are new files exists and not added to project repo.
    EOF
            exit 1
    fi
    

    Now, git gives warning while new files available and breaks process before commit. This also working on PyCharm with error popup.