I think you want a .gitattributes file where you set the EOL of the file types you care about. And you might want to try autocrlf=input.