30

I ignore *.sqlite3 file both in the project directory and the global gitignore config, but after that the sqlite3 file show in the git modified log every time. How can I fix that?

eddie yang
  • 1,241
  • 2
  • 13
  • 15

3 Answers3

50

If the file(s) is already in the repo ( ie. it is versioned ) it will continue to show as modified if you make changes to it. To make git start ignore them, first unversion the files ( using git rm --cached and git commit )

manojlds
  • 290,304
  • 63
  • 469
  • 417
8

If the file is in the repository, then ignoring it will have no effect. Remove it from the repository, or mark it as unchanged.

Community
  • 1
  • 1
Josh Lee
  • 171,072
  • 38
  • 269
  • 275
1
git rm --cached db.sqlite3
git commit
Toby Speight
  • 27,591
  • 48
  • 66
  • 103
Diego Bianchi
  • 601
  • 5
  • 10