micah kam
micah kam

Reputation: 21

Why is it recommended to add sqlite database to gitignore?

I understand other files being ignored. But why would I want to ignore the SQLite database file if that holds data needed to run the website? How can the website function without a database?

Upvotes: 1

Views: 3978

Answers (2)

Tech
Tech

Reputation: 945

Because you should want to use different databases on testing environment and production environment

Upvotes: 0

user9706
user9706

Reputation:

You probably only want to write to one instance of the file. This means it either lives in production or in your sandbox. If you change data in production, it's now newer than what you are tracking in git, and it will presumable be overwritten on the next deploy causing data loss.

Couple of minor issues:

  1. git doesn't perform well when you store large binary files in it.

  2. git can track binary files (like images) but you don't get as much value like being able to diff your .sqlite file before/after a change.

Upvotes: 2

Related Questions