If you want your sqlite database to be part of your repository, proceed as follows:
- edit the file
.gitignore
- remove or comment out the line
db.sqlite3
- add your database to the repository:
git add db.sqlite3
- commit your changes:
git commit -m'Add db.sqlite3 to the repository'
- push your changes so your colleagues get your database:
git push
Although these steps answer your question, I think that doing this is a very bad idea and I really encourage you to not include your sqlite database in the repository.
There is a reason why the guys at Django put that file in the .gitignore
. If you are developing in your local machine, whatever you do that affects the database (create or modify tables, add, remove or update records. etc) will create a modified version of db.sqlite3
that you will commit and push to the remote repository.
Now, let's suppose there is somebody else collaborating in the project with you. If your collaborator edits records, adds tables or does whatever thing that modifies his local database, he will have changes in the file db.sqlite3
. If he tries to merge his commits with your commits, you will have a conflict in the file db.sqlite3
that will be very difficult (if not impossible) to solve.
I don't use Django, so I cannot help you there, but what you need is a way to populate (or seed) the database. @iklinac gave you a link in the comments about how to create initial data for a Django project.
What you commit to the repository is the way to populate the database for the first time, but you keep your local databases out of the repository.