Normalizing line endings in a Git repo
The best way to do this is wipe out your working tree (all the files except the .git directory) and then restore them. Make sure you’ve committed any work before you do this, or it will be lost. link.
Read other posts