Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitignore does not ignore files

Tags:

git

gitignore

enter image description here The image says it all. Why is git telling me that I've changed the file when I'm explicitly telling it to ignore it?

like image 1000
frankelot Avatar asked Oct 25 '25 14:10

frankelot


1 Answers

A .gitignore specifies files that should not be added to git's index. It does not prevent changes to files that are already in the index.

If you want to remove the file completely from the index, you will need to commit a deletion of that file. Then if the file gets recreated (and it is still listed in .gitignore), it will not be re-added to the index.

like image 103
Maximillian Laumeister Avatar answered Oct 27 '25 06:10

Maximillian Laumeister