Perhaps you have files that were already tracked with git before you changed .gitignore? These files (at least in git 1.9.1) are not ignored when added to .gitignore.
For example, I created a “test” directory in the root file of one of my repositories and put the file in it:
mkdir test echo "abc" > test/x.txt
I added, locked and pressed. Then I edited .gitignore in the root and added this line:
x.txt
I also did the editing for test / x.txt and added a new file:
echo "123" >> test/x.txt mkdir test2 echo "xyz" > test2/x.txt
Now when I run "git status", I see:
modified: .gitignore modified: test/x.txt
Thus, test2 / x.txt is ignored, but test / x.txt is still being monitored.
To make the file ignore, you can delete it, add and commit the deletion along with the .gitignore change, and then restore the file.
source share