Why git still shows files as modified after adding in .gitignore

Why git still shows files as modified after adding in .gitignore.

Your .gitignore is working, but it still tracks the files because they were already in the index. You have to run command :- git rm -r --cached .(your directory)/ or git rm -r --cached (file name)