A new .gitattributes rule only affects files that git touches afterwards. Files committed with Windows line endings stay that way until you tell git to look at them again.
echo '* text=auto eol=lf' > .gitattributes
git add .gitattributes
git add --renormalize .
git commit -m "Normalize line endings"
--renormalize runs every tracked file through the clean filters and line ending rules again and stages the result. Files that were committed with CRLF line endings get staged as LF, and git status shows them as modified. The rule * text=auto eol=lf tells git to store text files with LF and check them out with LF too, while leaving binary files alone.
Check the result with git diff --cached --stat before committing. Expect a big commit if many files had CRLF, so I’d keep it separate from real changes. It’s also a good candidate for a .git-blame-ignore-revs file.
Your working tree may still have the old line endings after this. Git only changed what’s staged. Other people get the normalized files on their next pull, but their own uncommitted changes in those files will conflict with every line. Pick a quiet moment, and tell the others before you push.
Further reading: git-add documentation, gitattributes documentation