'Why are some files not recognized by .gitgnore?

I have taken over a Vue/Gridsome project. The project can be started via the docker-compose.yml file. After booting the node container, all files in the .docker folder (~4000 files) were prepared for the GIT commit.

I then added the .docker folder in the .gitignore. Instead of ~4000 Files there are now only 6 files from the .docker folder. And I wonder why it doesn´t ignore these files although I put the whole folder .docker into the .gitignore folder.

Question: Why are these files not ignored?

My .gitignore

.bash_history (.docker/data/node)
update-notifier-npm.json (.docker/data/node/.config/configstore)
cli.json (.docker/data/node/.config/configstore/update-notifier-@gridsome)
anonymous-cli-metrics.json (.docker/data/node/.npm)
565911....de (.docker/data/.npm/index-v5/2b/b7)
30c54c....OO (.docker/data/.npm/index-v5/2b/b7)

.gitignore when i was clone the project

*.log
.cache
.DS_Store
src/.temp
node_modules
dist
.env
.env.*

then i add .docker folder to .gitgnore

.docker


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source