I am using Django for my site on DigitalOcean. So, I had to delete the migration files for one of my apps (accounts) and run makemigrations again. I don’t really recall when or why, but it has caused this error when I pull from origin:
``` $ git pull origin master From https://github.com/... ... error: The following untracked working tree files would be overwritten by merge: accounts/migrations/0001_initial.py Please move or remove them before you merge. Aborting ```
Locally, my accounts app has only one migration:
``` accounts > migrations __init__.py 0001_initial.py ```
When I run git status on the server, I get a lot of untracked files, and I can see two migrations related to my accounts app (even though locally I only have one migration file in the accounts/migrations) as well as other untracked files (not related to accounts app):
``` On branch master Untracked files: (use "git add <file>..." to include in what will be committed) accounts/migrations/0001_initial.py accounts/migrations/0002_alter_user_id.py ... ```
Given that I don’t want to mess with the production database, I don’t wish you to change the migration files on the server to replicate the local migration files unless this does not cause any problem for my server. So, how should I resolve this error?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!