Solution to PNG files not rendering on GitHub

I do most of my dev in WSL and occasionally I screw up line endings between Windows and WSL. I wanted to solve the line ending changes so I added a .gitattributes to root of repo file with this:

* text eol=lf

Everything worked great locally, but when I pushed to GitHub all of my pngs were borked.

So I did some sleuthing and discovered that I should add this to my .gitattributes file so pngs are treated as binary files.

* text=auto
* text eol=lf
*.png binary

In order for those changes to take effect, I had to run the following:

git rm --cached -r .
git add -A

I then committed and pushed to GitHub and that resolved the problem.

Jon