0

This is how my .gitignore file looks like:

/.env
/public/bundles/
/var/
/vendor/
/public/data/
/public/data/data.json

I added the data.json file later to the .gitignore file and now I have the problem that git does not accept the file as ignored. So whenever I make a change on the file, git is listing the file public/data/data.json in uncommited changes...

peace_love
  • 6,229
  • 11
  • 69
  • 157
  • 3
    Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – Adam Millerchip Jan 29 '19 at 09:47

1 Answers1

1

Whenever a file is already tracked by git, it will be that way no matter what .gitignore says. If you want to stop tracking it, try git rm --cached public/data/data.json. This will remove file from git, but not from the filesystem.

Stanowczo
  • 753
  • 5
  • 21