Follow the following steps to push from local and pull to server.
- make changes to models.py
- Use this cmd to add change to git . > git add models.py
- use this cmd to commit > git commit -m "your message"
- git push > this will push your local changes to repo.
- go to sever now.
- run cmd > git status
- see if there are any local changes done to models.py file.
- you can see those local changes using > git diff models.py
- If those changes are already in your repo. use this cmd to discard them > git checkout models.py
- Now run cmd which will take your latest changes from server.> git pull
P.S. : Use the same commands for all the changes made to any file into the clone.
South migrations for syncing database:
Initial :
1. python manage.py schemamigration --initial
2. python manage.py migrate --fake
Do any change to database and do following steps:
1. python manage.py schemamigration --auto
2. python manage.py migrate
Do not checkin the migration folder created in app as it will conflict between your local and production clone.
Note: All the history for south migrations are stored in south_migrations table in database.