Adding a mask file to .gitignoreitself and does not, of course, does not delete files from a remote repository (further here ).
All in all, this is a really bad idea for keeping SQLite databases under source control (including git). The best solution for this is to create a script that, if necessary, creates a template database. This script might look like this:
database.sql:
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS items (
item_id INTEGER AUTOINCREMENT PRIMARY KEY,
item_name VARCHAR(32)
);
CREATE INDEX IF NOT EXISTS items_item_name ON items (item_name);
COMMIT;
Then you can execute this script using the following command:
sqlite3 -init database.sql database.db ""
, database.db , . , . database.sql ( ), .